Postado Dezembro 18, 2022 2 anos local config = { onlyPremium = true, requiredLevel = 330, newLevel = 8, newExp = 4200, } function onSay(cid, words, param, channel) local player = Player(cid) local resets = player:getStorageValue(1020) if ((player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) or (player:isPzLocked())) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You cannot be in battle, please go to some protected zone.") return false end if ((config.onlyPremium) and (player:getPremiumDays() >= 1)) then if player:getLevel() >= config.requiredLevel then if player:getStorageValue(resets) < 0 then player:setStorageValue(resets, 0) end if player:getStorageValue(resets) >= 0 then player:setPlayerStorageValue(resets, (resets) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! Your character has been reseted. Now you have " .. resets .. " resets.") db.query("UPDATE `players` SET `level` = " .. config.newLevel .. ", `experience` = " .. config.newExp .. ", `resets` = " .. ((resets) + 1) .. " WHERE `id` = " .. player:getGuid()) player:remove() end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be level " .. config.requiredLevel .. " or higher.") end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be premium account.") end return true end Editado Dezembro 18, 2022 2 anos por Anderson Sacani (veja o histórico de edições)
Postado Dezembro 18, 2022 2 anos Autor aparece nada na tela do personagem e na distro isso Em 18/12/2022 em 14:12, Anderson Sacani disse: local config = { onlyPremium = true, requiredLevel = 330, newLevel = 8, newExp = 4200, } function onSay(cid, words, param, channel) local player = Player(cid) local resets = player:getStorageValue(1020) if ((player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) or (player:isPzLocked())) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You cannot be in battle, please go to some protected zone.") return false end if ((config.onlyPremium) and (player:getPremiumDays() >= 1)) then if player:getLevel() >= config.requiredLevel then if player:getStorageValue(resets) < 0 then player:setStorageValue(resets, 0) end if player:getStorageValue(resets) >= 0 then player:setPlayerStorageValue(resets, (resets) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! Your character has been reseted. Now you have " .. resets .. " resets.") db.query("UPDATE `players` SET `level` = " .. config.newLevel .. ", `experience` = " .. config.newExp .. ", `resets` = " .. ((resets) + 1) .. " WHERE `id` = " .. player:getGuid()) player:remove() end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be level " .. config.requiredLevel .. " or higher.") end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be premium account.") end return true end aparece isso na distro
Postado Dezembro 18, 2022 2 anos Em 18/12/2022 em 14:28, Carpes Jhon disse: aparece nada na tela do personagem e na distro isso aparece isso na distro Desculpe, foi erro meu de digitação Na linha 23, altere: player:setPlayerStorageValue(resets, (resets) + 1) para: player:setStorageValue(resets, (resets) + 1) Editado Dezembro 18, 2022 2 anos por DiigooMix (veja o histórico de edições)
Postado Dezembro 18, 2022 2 anos Solução local config = { onlyPremium = true, requiredLevel = 330, newLevel = 8, newExp = 4200, } function onSay(player, words, param) local resets = player:getStorageValue(1020) if ((player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) or (player:isPzLocked())) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You cannot be in battle, please go to some protected zone.") return false end if ((config.onlyPremium) and (player:getPremiumDays() >= 1)) then if player:getLevel() >= config.requiredLevel then if player:getStorageValue(resets) < 0 then player:setStorageValue(resets, 0) end if player:getStorageValue(resets) >= 0 then player:setStorageValue(resets, (resets) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! Your character has been reseted. Now you have " .. resets .. " resets.") db.query("UPDATE `players` SET `level` = " .. config.newLevel .. ", `experience` = " .. config.newExp .. ", `resets` = " .. ((resets) + 1) .. " WHERE `id` = " .. player:getGuid()) player:remove() end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be level " .. config.requiredLevel .. " or higher.") end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be premium account.") end return true end
Postado Dezembro 21, 2022 2 anos Autor Em 18/12/2022 em 14:47, DiigooMix disse: Desculpe, foi erro meu de digitação Na linha 23, altere: player:setPlayerStorageValue(resets, (resets) + 1) para: player:setStorageValue(resets, (resets) + 1) ele so esta deslogando e logando nao esta resetando alguem poderia me ajudar no discord ou por outra forma a montar esse script estou a dias a procura obrigado. (JHON#3101) DC
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.