Malusz 0 Postado Janeiro 23, 2014 Share Postado Janeiro 23, 2014 Gostaria de colocar exhausted de 2 segundos para usar este comando novamente na seguinte talk: (Obs: Não retirem nenhuma função da talkaction porfavor). Mostrar conteúdo oculto function onSay(cid, words, param) if not isPremium(cid) then return doPlayerSendCancel(cid, "You need P.A to use speed.") end local tempopravoltaraonormaldepoisdetercorridobastante = 10 function tira() if isInArray(getPlayersOnline(),cid) then doChangeSpeed(cid,-1200) end end doChangeSpeed(cid,600) addEvent(tira,tempopravoltaraonormaldepoisdetercorridobastante*1000) doCreatureSay(cid, "Strong Haste", TALKTYPE_ORANGE_1) return true end Link para o comentário https://xtibia.com/forum/topic/227666-exhaust-em-uma-talk/ Compartilhar em outros sites More sharing options...
FlamesAdmin 261 Postado Janeiro 23, 2014 Share Postado Janeiro 23, 2014 Mostrar conteúdo oculto function doRemoveAbnormalSpeed(cid)if not isCreature(cid) or not isPlayer(cid) then return false enddoChangeSpeed(cid, -500)return trueendfunction onSay(cid, words, param)time = 10needPremium = falseexhaustTime = 60if needPremium and not isPremium(cid) thendoPlayerSendTextMessage(cid, 27, "Voce precisa de Premium Account para usar esse comando.")return trueendif exhaustion.get(cid, 8554) and exhaustion.get(cid, 8554) > 0 thendoPlayerSendTextMessage(cid, 27, "Por favor, espere "..exhaustion.get(cid, 8554).." segundos para usar esse comando novamente.")return trueenddoChangeSpeed(cid,200)addEvent(doRemoveAbnormalSpeed, time*1000, cid)doCreatureSay(cid, "Strong Haste!", TALKTYPE_ORANGE_1)exhaustion.set(cid, 8554, exhaustTime)return trueend Link para o comentário https://xtibia.com/forum/topic/227666-exhaust-em-uma-talk/#findComment-1606853 Compartilhar em outros sites More sharing options...
meubk 257 Postado Janeiro 23, 2014 Share Postado Janeiro 23, 2014 if exhaustion.get(cid, 8554) and exhaustion.get(cid, 8554) > 0 then WHAT ? Link para o comentário https://xtibia.com/forum/topic/227666-exhaust-em-uma-talk/#findComment-1606905 Compartilhar em outros sites More sharing options...
zipter98 1101 Postado Janeiro 23, 2014 Share Postado Janeiro 23, 2014 Legal essa variável aqui, local tempopravoltaraonormaldepoisdetercorridobastante = 10 Outra: pra quê usar isso if isInArray(getPlayersOnline(), cid) then ... end Se pode usar isso? if not isCreature(cid) then return true end Você economiza uma linha. De qualquer maneira, local exausted = 2 function onSay(cid, words, param) if not isPremium(cid) then return doPlayerSendCancel(cid, "You need P.A to use speed.") elseif getPlayerStorageValue(cid, 91821) > os.time() then return doPlayerSendCancel(cid, "Wait "..getPlayerStorageValue(cid, 91821).." seconds.") end local tempopravoltaraonormaldepoisdetercorridobastante = 10 function tira() if isInArray(getPlayersOnline(), cid) then doChangeSpeed(cid,-1200) end end doChangeSpeed(cid, 600) addEvent(tira, tempopravoltaraonormaldepoisdetercorridobastante*1000) doCreatureSay(cid, "Strong Haste", TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, 91821, os.time() + exausted) return true end Link para o comentário https://xtibia.com/forum/topic/227666-exhaust-em-uma-talk/#findComment-1606911 Compartilhar em outros sites More sharing options...
FlamesAdmin 261 Postado Janeiro 23, 2014 Share Postado Janeiro 23, 2014 Em 23/01/2014 em 16:21, zipter98 disse: Legal essa variável aqui, local tempopravoltaraonormaldepoisdetercorridobastante = 10 Outra: pra quê usar isso if isInArray(getPlayersOnline(), cid) then ... end Se pode usar isso? if not isCreature(cid) then return true end Você economiza uma linha. De qualquer maneira, local exausted = 2 function onSay(cid, words, param) if not isPremium(cid) then return doPlayerSendCancel(cid, "You need P.A to use speed.") elseif getPlayerStorageValue(cid, 91821) > os.time() then return doPlayerSendCancel(cid, "Wait "..getPlayerStorageValue(cid, 91821).." seconds.") end local tempopravoltaraonormaldepoisdetercorridobastante = 10 function tira() if isInArray(getPlayersOnline(), cid) then doChangeSpeed(cid,-1200) end end doChangeSpeed(cid, 600) addEvent(tira, tempopravoltaraonormaldepoisdetercorridobastante*1000) doCreatureSay(cid, "Strong Haste", TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, 91821, os.time() + exausted) return true end Nao foi eu que fiz esse script ai, kkkk Link para o comentário https://xtibia.com/forum/topic/227666-exhaust-em-uma-talk/#findComment-1607050 Compartilhar em outros sites More sharing options...
zipter98 1101 Postado Janeiro 24, 2014 Share Postado Janeiro 24, 2014 (editado) Opa, eu não me referi a seu código, e sim ao que o autor enviou. e.e Mas, mesmo com essas minhas observações, mantive o código do jeito que estava (já que foi pedido pelo autor). Editado Janeiro 24, 2014 por zipter98 Link para o comentário https://xtibia.com/forum/topic/227666-exhaust-em-uma-talk/#findComment-1607118 Compartilhar em outros sites More sharing options...
Posts Recomendados