Postado Setembro 5, 2015 9 anos Alguém poderia me ajudar nessa script, eu gostaria que ela so pudesse ser usada fora de protection zone e quando ela fosse usada, o char que a usou pegasse pk local money = {} local player = {} local position = {} local config = { corpseId = 3058, -- Item Id timee = 6000 -- Seconds } local function allowMovement(cid) if not isPlayer(cid) then return end doCreatureSetNoMove(cid, false) end local function stealMoney(cid) position = getDistanceBetween(getPlayerPosition(player), getPlayerPosition(cid)) if position < 2 then doPlayerRemoveMoney(cid, money) doPlayerAddMoney(player, money) doPlayerSendTextMessage(player,MESSAGE_INFO_DESCR,"Você roubou "..money.." gold!") doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'VOCÊ ACABA DE SER ROUBADO!') else doPlayerSendTextMessage(player,MESSAGE_INFO_DESCR,"Roubo cancelado.") end end function onUse(cid, item, fromPosition, itemEx, toPosition) if isPlayer(itemEx.uid) then doSetItemOutfit(itemEx.uid, config.corpseId, config.timee) doCreatureSetNoMove(itemEx.uid, true) addEvent(allowMovement, config.timee, itemEx.uid) money = getPlayerMoney(itemEx.uid) player = cid doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Roubando...') doPlayerSendTextMessage(itemEx.uid,MESSAGE_INFO_DESCR,'Você foi nocauteado!') addEvent(stealMoney, config.timee-3000, itemEx.uid) end return true end Editado Setembro 5, 2015 9 anos por Pino Potter (veja o histórico de edições)
Postado Setembro 5, 2015 9 anos nao testei mas ver se funciona ae. local money = {} local player = {} local position = {} local config = { corpseId = 3058, -- Item Id timee = 6000 -- Seconds } local function allowMovement(cid) if not isPlayer(cid) then return end doCreatureSetNoMove(cid, false) end local function stealMoney(cid) position = getDistanceBetween(getPlayerPosition(player), getPlayerPosition(cid)) if not(getTilePzInfo(getCreaturePosition(cid))) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Mensagem para o player quando estive dentro do pz.") end if position < 2 then doPlayerRemoveMoney(cid, money) doPlayerAddMoney(player, money) doPlayerSendTextMessage(player,MESSAGE_INFO_DESCR,"Você roubou "..money.." gold!") doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'VOCÊ ACABA DE SER ROUBADO!') else doPlayerSendTextMessage(player,MESSAGE_INFO_DESCR,"Roubo cancelado.") end end function onUse(cid, item, fromPosition, itemEx, toPosition) if isPlayer(itemEx.uid) then doSetItemOutfit(itemEx.uid, config.corpseId, config.timee) doCreatureSetNoMove(itemEx.uid, true) doCreatureSetSkullType(cid, SKULL_WHITE) addEvent(allowMovement, config.timee, itemEx.uid) money = getPlayerMoney(itemEx.uid) player = cid doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Roubando...') doPlayerSendTextMessage(itemEx.uid,MESSAGE_INFO_DESCR,'Você foi nocauteado!') addEvent(stealMoney, config.timee-3000, itemEx.uid) end return true end
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.