LucasFerraz
Systems Analyst
Hello,
I need this script:
If druid step in with 20 enchanted small emerald he get teleported.
if druid step in without 20 enchanted small emerald he get back to old position (with message "Only druids with 20 enchanted small emeralds may enter here.)
if other vocation step in get back to old position(with message "Only druids with 20 enchanted small emeralds may enter here.)
if other vocation step in with 20 enchanted small emerald get back to old position (with message "Only druids with 20 enchanted small emeralds may enter here.)
Here is my script, its not working
I need this script:
If druid step in with 20 enchanted small emerald he get teleported.
if druid step in without 20 enchanted small emerald he get back to old position (with message "Only druids with 20 enchanted small emeralds may enter here.)
if other vocation step in get back to old position(with message "Only druids with 20 enchanted small emeralds may enter here.)
if other vocation step in with 20 enchanted small emerald get back to old position (with message "Only druids with 20 enchanted small emeralds may enter here.)
Here is my script, its not working
Lua:
function onStepIn(cid, item, position, fromPosition)
local pos = {x=33427, y=31829, z=13}
local leave = {x=33266, y=31832, z=9}
local was = fromPosition
vocation = getPlayerVocation(cid)
if(getPlayerItemCount(cid, 7761) >= 20) and vocation == 2 or vocation == 6 or vocation == 10 then
doPlayerRemoveItem(cid, 7761, 20)
doTeleportThing(cid,pos)
elseif(getPlayerItemCount(cid, 7761) <= 20) then
doTeleportThing(cid, was)
doPlayerSendTextMessage(0, cid, 22, "Only druids with 20 enchanted small emeralds may enter here.")
end
end