I made a scriptt to train, when the player clik on the door + a player is teleported when other players come and click on the door will say that training is busy.
The problem comes when the player stands in front of the door, the player who is in on the training can not leave, he just quit when the player leaves the front door.
function onUse(cid, item, pos)
local toPos = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=253}
local tooPos = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=253}
if not isPlayer(getThingfromPos(toPos).uid) then
doTeleportThing(cid, toPos)
doSendMagicEffect(getCreaturePosition(cid), 12)
elseif not isPlayer(getThingfromPos(tooPos).uid) then
doTeleportThing(cid, tooPos)
doSendMagicEffect(getCreaturePosition(cid), 12)
else
doPlayerSendTextMessage(cid,20, "Essa sala de treinamento está ocupada.")
end
return TRUE
end
The problem comes when the player stands in front of the door, the player who is in on the training can not leave, he just quit when the player leaves the front door.