ghettobird
LUA newbie
Hello Otlanders, sorry i've been inactive i was reading a lot of tutorials about lua, so i came up with this and i really hope it's useful
Ok so how does this work? let's say i have 100cc and i want to go through a teleport (maybe it has special monsters) when i go inside the teleport 50cc will be removed, if i don't have 50cc it will say "YOU NEED 50 crystal coins to go in!
hope you guys like it =)
Lua:
function onStepIn(cid, item, position, fromPosition)
if(getPlayerItemCount(cid, 2160) >= 50) then
doPlayerRemoveItem(cid, 2160, 50)
else
doPlayerSendCancel(cid, "You need 50 Crystal Coins To Go IN!")
end
doTeleportThing(cid, {x=994,y=1003,z=7}, true)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "TELEPORTED")
return true
end
Ok so how does this work? let's say i have 100cc and i want to go through a teleport (maybe it has special monsters) when i go inside the teleport 50cc will be removed, if i don't have 50cc it will say "YOU NEED 50 crystal coins to go in!
hope you guys like it =)