Cypher
TwinkSoft Owner
- Joined
- Mar 21, 2011
- Messages
- 834
- Reaction score
- 16
Hey guys i made this script (i'm a newbie at lua)
It is supposed to remove 100 crystal coins when you pull a lever, but it doesn't remove the money.
Also, there's a problem in the LUA tester:
Thank you in advance!
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveItem(cid, 2160, 100) then
local v, tmp = math.random(333), getCreatureOutfit(cid)
while isInArray({tmp.lookType, 75, 135, 266, 302}, v) == TRUE or v <= 1 or (v > 160 and v < 192) or v > 333 do
v = math.random(351)
end
else
doCreatureSay(cid, "You don't have enough money to get a custom outfit!", TALKTYPE_ORANGE_1, false, cid)
end
tmp.lookType = v
doCreatureChangeOutfit(cid, tmp)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doCreatureSay(cid, 'Your outfit has been changed.', TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
return true
end
end
It is supposed to remove 100 crystal coins when you pull a lever, but it doesn't remove the money.
Also, there's a problem in the LUA tester:
input:18: '<eof>' expected near 'end
Thank you in advance!