eardrums
Member
- Joined
- May 27, 2010
- Messages
- 94
- Solutions
- 1
- Reaction score
- 10
Hey guys,
I'm trying to a very simple script to upgrade a weapon. Still just trying to learn how it all works and I cant figure out a specific section.
here is the script
In the item:setAttribute part. Putting in attack,defense, or attackspeed all work. but when i try to add sword fighting or anything else for that matter it doesnt change the sword and if i try to upgrade a 2nd time on top of that it crashes the server. instead of "attackspeed" i put in skillsword for example. What am I doing wrong?
thanks!
I'm trying to a very simple script to upgrade a weapon. Still just trying to learn how it all works and I cant figure out a specific section.
here is the script
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 2385 and
player:getItemCount(2147) >= 10 then
item:setAttribute("attackspeed", item:getAttribute("attackspeed") + 5)
player:removeItem(2147,10)
player:say("WOOT!", TALKTYPE_MONSTER_SAY)
elseif player:getItemCount(2147) < 10 then
player:say("You do not have enough upgrade materials.", TALKTYPE_MONSTER_SAY)
end
return true
end
In the item:setAttribute part. Putting in attack,defense, or attackspeed all work. but when i try to add sword fighting or anything else for that matter it doesnt change the sword and if i try to upgrade a 2nd time on top of that it crashes the server. instead of "attackspeed" i put in skillsword for example. What am I doing wrong?
thanks!