Minha dúvida é se essa função (No caso seria uma runa que somente gm, god e adm poderiam usar).
Bom, estou tetando aprender a criar funções, então, estava fazendo mas acho que tem algo errado ai... Alguém pode me ajudar? A ver se tem algo errado e que não deixaria a runa funcionar corretamente?
function onUse(cid, item, frompos, item2, topos)
player1pos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player1 = getThingfromPos(player1pos)
target = player1.uid
templewinpos = {x=0,y=0,z=0} -- Coordenadas da sala de Recompensas.
player1positions = {
{x=0,y=0,z=0},
{x=1,y=1,z=1},
{x=2,y=2,z=2}
} -- Locais onde é possível usar a runa no player.
if getPlayerAccess(cid) =>= 2 then
if getCreaturePosition(target) = isInArray(player1positions, TRUE) then
if getPlayerAccess(target) = 1 then
doTeleportThing(target, templewinpos)
setPlayerStorageValue(target, 9999, 0)
doPlayerBroadcastMessage(target, "Congratulations, you won the game. Take your prizes in the chests and head to the exit.", 10)
doSendMagicEffect(topos, 10)
doSendAnimatedText(topos, "Winner!", 140)
else doPlayerBroadcastMessage(cid, "Sorry, you can not use this item if not in a player.", 10)
else doPlayerBroadcastMessage(cid, "Sorry, you can only use this item for players who are in the awards position.", 10)
else doPlayerBroadcastMessage(cid, "Sorry, you havent access to use this item.", 10)
end
end
end
end
PS: Os valores dos efeitos, e da storage são ficticios....
Pergunta
Derlexy 0
Minha dúvida é se essa função (No caso seria uma runa que somente gm, god e adm poderiam usar).
Bom, estou tetando aprender a criar funções, então, estava fazendo mas acho que tem algo errado ai... Alguém pode me ajudar? A ver se tem algo errado e que não deixaria a runa funcionar corretamente?
PS: Os valores dos efeitos, e da storage são ficticios....
Editado por DerlexyLink para o comentário
https://xtibia.com/forum/topic/192910-d%C3%BAvida-no-script-de-uma-runa/Compartilhar em outros sites
13 respostass a esta questão
Posts Recomendados