Advent
Custom RPG Maker
- Joined
- Oct 3, 2009
- Messages
- 306
- Reaction score
- 7
http://otland.net/f81/perfect-items-upgrade-2-0-slot-sytem-89450/
Point : I am using Perfect Upgrade script and I want to add Attack Speed option for weapons and bows/crossbows only.
I tried creating new functions and locals only to try if it will work but it doesn't.
I am getting an error :
You don't have to explain me what does it mean.
These are my functions to get and set attack speed. When I use /attr set attackspeed 5000 on item, it gives item one hit per 5 sec. When I use /attr set attackspeed 500 on item, it gives me like 2 hits in one sec. It all works but when I use upgrade item it doesnt. Do I call wrong global ? Where is my mistake ?
I wanted it to increase Attack Speed -250 ms per 1 lvl. I used it like SetAttackSpeed (GetAttackSpeed-250*level -- weapon level --)
Can you help me somehow ? Explain ? I am going to try it other way but I am looking for your assistance.
- - - Updated - - -
I changed functions into
and got another error
106 ofc
- - - Updated - - -
I did it alone, please close thread.
Point : I am using Perfect Upgrade script and I want to add Attack Speed option for weapons and bows/crossbows only.
I tried creating new functions and locals only to try if it will work but it doesn't.
I am getting an error :
[26/04/2013 21:58:58] [Error - Action Interface]
[26/04/2013 21:58:58] data/actions/scripts/other/upgrade.luanUse
[26/04/2013 21:58:58] Description:
[26/04/2013 21:58:58] data/actions/scripts/other/upgrade.lua:46: attempt to call global 'setItemAttribute' (a nil value)
[26/04/2013 21:58:58] stack traceback:
[26/04/2013 21:58:58] data/actions/scripts/other/upgrade.lua:46: in function 'setItemAttackSpeed'
[26/04/2013 21:58:58] data/actions/scripts/other/upgrade.lua:145: in function <data/actions/scripts/other/upgrade.lua:106>
You don't have to explain me what does it mean.
Lua:
function getItemAttackSpeed(uid)
return getItemAttribute(uid,'attackspeed')
end
function setItemAttackSpeed(uid)
return setItemAttribute(uid,'attackspeed',name)
end
I wanted it to increase Attack Speed -250 ms per 1 lvl. I used it like SetAttackSpeed (GetAttackSpeed-250*level -- weapon level --)
Can you help me somehow ? Explain ? I am going to try it other way but I am looking for your assistance.
- - - Updated - - -
I changed functions into
Lua:
function getItemAttackSpeed(uid)
return getItemAttribute(uid,attackspeed)
end
function setItemAttackSpeed(uid)
return setItemAttribute(uid,attackspeed)
end
and got another error
143[26/04/2013 22:20:54] [Error - Action Interface]
[26/04/2013 22:20:54] data/actions/scripts/other/upgrade.luanUse
[26/04/2013 22:20:54] Description:
[26/04/2013 22:20:54] data/actions/scripts/other/upgrade.lua:143: attempt to perform arithmetic on a nil value
[26/04/2013 22:20:54] stack traceback:
[26/04/2013 22:20:54] data/actions/scripts/other/upgrade.lua:143: in function <data/actions/scripts/other/upgrade.lua:106>
Lua:
local gainAS = getItemAttackSpeed(itemEx.uid)-(250*level)
local loseAS = getItemAttackSpeed(itemEx.uid)+(250*level)
106 ofc
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
- - - Updated - - -
I did it alone, please close thread.
Last edited: