Postado Abril 13, 2015 10 anos Estou querendo um script que o player ao entrar no teleport ganhe tal item, e que só ganhe este item uma vez.
Postado Abril 13, 2015 10 anos Solução Em "Data/movements/scripts" adicione newtpitem.lua: local t = { storage = 23444, -- Só mexa se estiver em uso. tp = { x = 32338, y = 32225, z = 7 }, -- Local onde irá levar. item = 2472 -- Item que irá ganhar. } function onStepIn(cid, item, position, fromPosition) if getPlayerFreeCap(cid) < getItemWeight(t.item, 1) and getPlayerStorageValue(cid, t.storage) <= 0 then doPlayerSendCancel(cid, "You not have ".. getItemWeight(t.item, 1) .." cap.") doTeleportThing(cid, fromPosition) return doSendMagicEffect(getCreaturePosition(cid), 13) end if getPlayerStorageValue(cid, t.storage) <= 0 then doPlayerAddItem(cid, t.item, 1) doTeleportThing(cid, t.tp) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, t.storage, 1) else doTeleportThing(cid, t.tp) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end return true end Agora em "Data/movements" abra o movements.xml e adicione: <movevent event="StepIn" actionid="8594" script="newtpitem.lua"/> Ai é só colocar a actionid no teleport. ➥ Regras | Seções OTServ | Seções BOT
Postado Abril 15, 2015 10 anos eu qro q ganhe 5 itens diferentes como eu faço? Teste assim: local t = { storage = 23444, tp = { x = 32338, y = 32225, z = 7 }, -- Local onde irá levar. item = {2472, 2473, 2474} -- Items. } function onStepIn(cid, item, position, fromPosition) if getPlayerFreeCap(cid) < getItemWeight(t.item, 1) and getPlayerStorageValue(cid, t.storage) <= 0 then doPlayerSendCancel(cid, "You not have ".. getItemWeight(t.item, 1) .." cap.") doTeleportThing(cid, fromPosition) return doSendMagicEffect(getCreaturePosition(cid), 13) end if getPlayerStorageValue(cid, t.storage) <= 0 then for x = 1, #t.item do doPlayerAddItem(cid, t.item[x], 1) doTeleportThing(cid, t.tp) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, t.storage, 1) end else doTeleportThing(cid, t.tp) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end return true end ➥ Regras | Seções OTServ | Seções BOT
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.