Hello i need help, i tested my script but only one way working, i need work all script..
So when we ppm on item, if we have storage 2000, 127 and vocation 1,101,102,103 etc then teleport here:
player:teleport({x = 576, y = 35, z = 7})
and when we have storage 2000, 127 and vocation 2, 200, 201, 202 then teleport here:
player:teleport({x = 536, y = 55, z = 7})
i try this script but only work with storage, vocation dont work can you help me?
So when we ppm on item, if we have storage 2000, 127 and vocation 1,101,102,103 etc then teleport here:
player:teleport({x = 576, y = 35, z = 7})
and when we have storage 2000, 127 and vocation 2, 200, 201, 202 then teleport here:
player:teleport({x = 536, y = 55, z = 7})
i try this script but only work with storage, vocation dont work can you help me?
Code:
local cfg = {
storaged = 2000, -- change storage to whatever you want it.
}
local vocs = {
One = {1, 101, 102, 103, 104, 105, 106, 107},
Two = {2, 6},
Three = {3, 7},
Four = {4, 8}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
player.add(cid)
if player:storage('check', STORAGE_PLAYER_MISSION_NUMBER, 127) and getPlayerVocation(cid) == vocs.one then
player:teleport({x = 576, y = 35, z = 7})
elseif player:storage('check', STORAGE_PLAYER_MISSION_NUMBER, 127) and getPlayerVocation(cid) == vocs.two then
player:teleport({x = 576, y = 35, z = 7})
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already fight with this.")
end
return TRUE
end