mude isso:
if skillId.add == "none" then
return false
elseif skillId.add == "speed" then
doChangeSpeed(cid, getCreatureSpeed(cid)+(value*skillId.count))
elseif skillId.add == "health" then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+(value*skillId.count))
elseif skillId.add == "mana" then
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+(value*skillId.count))
end
para isso:
if skillId.add == "speed" then doChangeSpeed(cid, getCreatureSpeed(cid)+(value*skillId.count)) elseif skillId.add == "health" then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+(value*skillId.count)) elseif skillId.add == "mana" then setCreatureMaxMana(cid, getCreatureMaxMana(cid)+(value*skillId.count)) end


info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif
Fala ai galera , eu to com outro script aqui que deu um errorzinho.
se o ITEM for add = "none"
ele nao funciona , poderiam me ajudar?
script :
local maxSkills = 100 local skillTable = { --[id do item] = id da skill, [2400] = {id = 0, count = 1, add = "none"}, -- Strenght [2404] = {id = 1, count = 3, add = "speed"}, -- Agility [2403] = {id = 2, count = 20, add = "health"}, -- Vitality [2402] = {id = 3, count = 15, add = "mana"}, -- Energy [2401] = {id = 4, count = 1, add = "none"}, -- Range [2405] = {id = 5, count = 1, add = "none"}, -- Defense } local function doPlayerSetSkill(pid, skill, amount) local player = getPlayerByGUID(pid) if isCreature(player) then doRemoveCreature(player, true) end db.executeQuery("UPDATE `player_skills` SET `value` = ".. amount .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. skill ..";") return true end local function doPlayerSetMagic(pid, amount) local player = getPlayerByGUID(pid) if isCreature(player) then doRemoveCreature(player, true) end db.executeQuery("UPDATE `players` SET `maglevel` = " .. amount .. " WHERE `id` = "..pid) return true end function onTextEdit(cid, item, newText) local skillId = skillTable[item.itemid] if not skillId then return true end local guid = getPlayerGUID(cid) local points = getPlayerMagLevel(cid) local skill = getPlayerSkillLevel(cid, skillId.id) local value = tonumber(newText) if not value or value < 0 then doPlayerSendCancel(cid, "Por favor, insira um número válido.") return false elseif getPlayerInFight(cid) == 1 then doPlayerSendCancel(cid, "Você não pode estar em PZ.") return false elseif points < value then doPlayerSendCancel(cid, "Você não tem points suficientes.") return false elseif skill >= maxSkills then doPlayerSendCancel(cid, "Sua skill já está no máximo.") return false end local newValue = math.min(skill + value, maxSkills) if skillId.add == "none" then return false elseif skillId.add == "speed" then doChangeSpeed(cid, getCreatureSpeed(cid)+(value*skillId.count)) elseif skillId.add == "health" then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+(value*skillId.count)) elseif skillId.add == "mana" then setCreatureMaxMana(cid, getCreatureMaxMana(cid)+(value*skillId.count)) end doPlayerSetSkill(guid, skillId.id, newValue) doPlayerSetMagic(guid, points - newValue + skill) return false end