Ir para conteúdo

Posts Recomendados

Tipo do script: Actions

Protocolo (versão do Tibia): 8.60

Servidor utilizado: TFS 0.4

Nível de experiência: Depende de sua ajuda :D

Adicionais/Informações:

 

Olhem, é um script que eu tou tentando fazer, é o seguinte.

 

Vai ter um treiner, para ter acesso a esse treiner tem um door gate of experience, quando o player clica na door, ele é teleportado +1, ae quando o outro player vim e clicar na door, vai dizer que o treiner está ocupado, so pode entra se o outro player que ta ultilizando o treiner, sair ou logar.

 

Eu consiguir faze-lo mais quando o player está no treiner, ele nao pode sair, e fica aparecendo a msg (O trainer está ocupado.) mesmo ele dentro ... Se alguem puder ajudar ae !

 

Script:

 

function onUse(cid, item, pos)

local toPos = {x=pos.x-2,y=pos.y,z=pos.z,stackpos=253}

 

if not isPlayer(getThingfromPos(toPos).uid) then

doTeleportThing(cid, toPos)

doSendMagicEffect(getCreaturePosition(cid), 13)

else

doPlayerSendTextMessage(cid,20,"O trainer está ocupado.")

end

return TRUE

end

 

Se alguem puder me ajudar ae ! VLWWW :p

 

ALGUEM AJUDA AE?

Editado por Esaus
Link para o comentário
https://xtibia.com/forum/topic/183335-action-door-~-lugar-ocupado-ajuda/
Compartilhar em outros sites

Usa esse...

 

function onUse(cid, item, frompos, item2, topos)

 

-- <beginning> Training Room script.

-- Version 1.0, last edited 2006-06-02 17:39

 

-- Beginning of editable Variabels

aidNor = 4211 -- Action id for door where training room is north of door

aidSou = 4212 -- Action id for door where training room is south of door

aidWes = 4213 -- Action id for door where training room is west of door

aidEas = 4214 -- Action id for door where training room is east of door

-- End of editable Variabels

 

emptyRoom = true

charPos = getPlayerPosition(cid)

 

if (item.actionid == aidNor) then

if (charPos.y < frompos.y) then

othersidePos = {x=frompos.x, y=frompos.y+1, z=frompos.z}

else

othersidePos = {x=frompos.x, y=frompos.y-1, z=frompos.z, stackpos=253}

things = getThingfromPos(othersidePos)

if (things.itemid == 1) then

if (getPlayerLevel(things.uid) > 0) then

emptyRoom = false

end

end

end

 

elseif (item.actionid == aidSou) then

if (charPos.y > frompos.y) then

othersidePos = {x=frompos.x, y=frompos.y-1, z=frompos.z}

else

othersidePos = {x=frompos.x, y=frompos.y+1, z=frompos.z, stackpos=253}

things = getThingfromPos(othersidePos)

if (things.itemid == 1) then

if (getPlayerLevel(things.uid) > 0) then

emptyRoom = false

end

end

end

 

elseif (item.actionid == aidEas) then

if (charPos.x > frompos.x) then

othersidePos = {x=frompos.x-1, y=frompos.y, z=frompos.z}

else

othersidePos = {x=frompos.x+1, y=frompos.y, z=frompos.z, stackpos=253}

things = getThingfromPos(othersidePos)

if (things.itemid == 1) then

if (getPlayerLevel(things.uid) > 0) then

emptyRoom = false

end

end

end

 

elseif (item.actionid == aidWes) then

if (charPos.x < frompos.x) then

othersidePos = {x=frompos.x+1, y=frompos.y, z=frompos.z}

else

othersidePos = {x=frompos.x-1, y=frompos.y, z=frompos.z, stackpos=253}

things = getThingfromPos(othersidePos)

if (things.itemid == 1) then

if (getPlayerLevel(things.uid) > 0) then

emptyRoom = false

end

end

end

 

end

 

if (emptyRoom == true) then

doTeleportThing(cid, othersidePos)

doSendMagicEffect(charPos, 2)

doSendMagicEffect(frompos, 12)

doSendMagicEffect(othersidePos, 10)

 

else

doPlayerSendTextMessage(cid, 22, "O treiner esta ocupado.Por favor procure outro ou espere o player sair.")

end

-- <end> Training Room script.

 

return 1

end

Editado por DuuhCarvalho
Link para o comentário
https://xtibia.com/forum/topic/183335-action-door-~-lugar-ocupado-ajuda/#findComment-1226855
Compartilhar em outros sites

×
×
  • Criar Novo...