Postado Setembro 18, 2018 6 anos So quero colocar tempo pra usar esse script .. rep ++ Spoiler local text = {"TOPSEASON"} local time = 5 local effects = {21, 2, 5, 11, 15, 19, 22, 28, 29, 33, 32, 35, 39, 53, 54, 78, 77} local storage,key = 6666671,1 local function doSendMessageAndEffect(cid, position, loop) if getPlayerStorageValue(cid,storage) ~= key then return end doSendAnimatedText(position, text[math.random(#text)], math.random(255)) doSendMagicEffect(position, effects[math.random(#effects)]) if loop then addEvent(doSendMessageAndEffect,time*1000,cid, getThingPos(cid),true) end end function onSay(cid, words, param) local position = getThingPos(cid) doSendMessageAndEffect(cid, position,true) return true end
Postado Setembro 22, 2018 6 anos @iury alves potter Spoiler local text = {"TOPSEASON"} local time = 5 local effects = {21, 2, 5, 11, 15, 19, 22, 28, 29, 33, 32, 35, 39, 53, 54, 78, 77} local storage,key = 6666671,1 local tempo = 900 -- Tempo para usar novamente local storage = 23585 -- storage pra verificar se o player já pode usar novamente local function doSendMessageAndEffect(cid, position, loop) if getPlayerStorageValue(cid,storage) ~= key then return end doSendAnimatedText(position, text[math.random(#text)], math.random(255)) doSendMagicEffect(position, effects[math.random(#effects)]) if loop then addEvent(doSendMessageAndEffect,time*1000,cid, getThingPos(cid),true) end end function onSay(cid, words, param) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar") return true end exhaustion.set(cid, storage, tempo) local position = getThingPos(cid) doSendMessageAndEffect(cid, position,true) return true end
Postado Setembro 23, 2018 6 anos 1 hora atrás, KotZletY disse: @iury alves potter Ocultar conteúdo local text = {"TOPSEASON"} local time = 5 local effects = {21, 2, 5, 11, 15, 19, 22, 28, 29, 33, 32, 35, 39, 53, 54, 78, 77} local storage,key = 6666671,1 local tempo = 900 -- Tempo para usar novamente local storage = 23585 -- storage pra verificar se o player já pode usar novamente local function doSendMessageAndEffect(cid, position, loop) if getPlayerStorageValue(cid,storage) ~= key then return end doSendAnimatedText(position, text[math.random(#text)], math.random(255)) doSendMagicEffect(position, effects[math.random(#effects)]) if loop then addEvent(doSendMessageAndEffect,time*1000,cid, getThingPos(cid),true) end end function onSay(cid, words, param) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar") return true end exhaustion.set(cid, storage, tempo) local position = getThingPos(cid) doSendMessageAndEffect(cid, position,true) return true end Pode ajudar para adaptar nesse? function onSay(cid, words, param, channel) if(param == '') then doSendMsg(cid, "Relate o bug da seguinte forma: '!report Encontrei um bug'") return true end local playerName, playerPos = getCreatureName(cid), getThingPos(cid) local str = "Nome: " .. playerName .. "\nPosX: " .. playerPos.x ..", PosY: " .. playerPos.y .. ", PosZ: " .. playerPos.z .. "\nData: " .. os.date() local file = io.open('data/reports/'.. playerName ..' Bug ' .. getAllReports(playerName) +1 .. '.txt', 'w') str = str .. "\n\nBug: " .. param file:write(str) file:close() doSendMsg(cid, 'Bug reportado com sucesso.') return true end function getAllReports(name) local count = 0 for i = 1, 300 do local file = io.open('data/reports/'.. name ..' Bug '.. i ..'.txt', 'r') if file ~= nil then io.close(file) count = count +1 end end return count end Eu tentei assim: local tempo = 900 -- Tempo para usar novamente local storage = 23585 -- storage pra verificar se o player já pode usar novamente function onSay(cid, words, param, channel) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar") return true end exhaustion.set(cid, storage, tempo) end if(param == '') then doSendMsg(cid, "Relate o bug da seguinte forma: '!report Encontrei um bug'") return true end local playerName, playerPos = getCreatureName(cid), getThingPos(cid) local str = "Nome: " .. playerName .. "\nPosX: " .. playerPos.x ..", PosY: " .. playerPos.y .. ", PosZ: " .. playerPos.z .. "\nData: " .. os.date() local file = io.open('data/reports/'.. playerName ..' Bug ' .. getAllReports(playerName) +1 .. '.txt', 'w') str = str .. "\n\nBug: " .. param file:write(str) file:close() doSendMsg(cid, 'Bug reportado com sucesso.') return true end function getAllReports(name) local count = 0 for i = 1, 300 do local file = io.open('data/reports/'.. name ..' Bug '.. i ..'.txt', 'r') if file ~= nil then io.close(file) count = count +1 end end return count end E recebi essa mensagem: Citar [22/09/2018 22:02:49] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/reportBug.lua) [22/09/2018 22:02:49] data/talkactions/scripts/reportBug.lua:10: unexpected symbol near 'ï Obrigado!
Postado Setembro 23, 2018 6 anos @ceesar90 talvez por causa de um problema existente no fórum, ao copiar algum texto, acaba vindo caracteres especiais ou alterando a do próprio texto: Spoiler local tempo = 900 -- Tempo para usar novamente local storage = 23585 -- storage pra verificar se o player já pode usar novamente function onSay(cid, words, param, channel) if(param == '') then doSendMsg(cid, "Relate o bug da seguinte forma: '!report Encontrei um bug'") return true end if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar") return true end exhaustion.set(cid, storage, tempo) local playerName, playerPos = getCreatureName(cid), getThingPos(cid) local str = "Nome: " .. playerName .. "\nPosX: " .. playerPos.x ..", PosY: " .. playerPos.y .. ", PosZ: " .. playerPos.z .. "\nData: " .. os.date() local file = io.open('data/reports/'.. playerName ..' Bug ' .. getAllReports(playerName) +1 .. '.txt', 'w') str = str .. "\n\nBug: " .. param file:write(str) file:close() doSendMsg(cid, 'Bug reportado com sucesso.') return true end function getAllReports(name) local count = 0 for i = 1, 300 do local file = io.open('data/reports/'.. name ..' Bug '.. i ..'.txt', 'r') if file ~= nil then io.close(file) count = count +1 end end return count end
Postado Setembro 23, 2018 6 anos @KotZletY Tudo bem? Obrigado pela ajuda! Continuo com o mesmo erro: Citar [23/09/2018 17:08:51] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/reportBug.lua:9: unexpected symbol near 'ï' [23/09/2018 17:08:51] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/reportBug.lua) [23/09/2018 17:08:51] data/talkactions/scripts/reportBug.lua:9: unexpected symbol near 'ï'
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.