local pnts = 10 function onUse(cid, item, frompos, item2, topos) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574)+pnts) doRemoveItem(item.uid, 1) return true end
achu q eh soh isso ![]()
\/ fail meu auhauh
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

local pnts = 10 function onUse(cid, item, frompos, item2, topos) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574)+pnts) doRemoveItem(item.uid, 1) return true end
achu q eh soh isso ![]()
\/ fail meu auhauh
Editado Março 18 por Slicer
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

o unico problema é q
se o cara ja tiver algum ponto
os pontos passam a ser 10
como posso colocar pra add
local pnts = 10 function onUse(cid, item, frompos, item2, topos) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid,14574)+pnts) doRemoveItem(item.uid, 1) return true end
creditos ao slicer pq ele fez td mas se for dá rep dá pra mim pq sou mais bonito
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

aee vlw funcionando direitinho =)
dei +rep pros dois
duvida sanada ja reportei
Editado Março 18 por rohfagundes
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78
gente eu to querendo um script de um item q de pontos
o tipo de ponto é desse sistema de pontos por level
local VocPoints = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, } function onSay(cid, words, param) if not (VocPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = string.explode(param, ",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end local skillids = { ["fist"] = 0, ["shield"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["distance"] = 4 } local attributes = { ["fist"] = {np = 4, vl = 1, nm = "Fist Skill"}, -- np = quantidade de pontos q precisa -- vl = quantos pontos de skill vai ganhar ["life"] = {np = 2, vl = 5, nm = "Hit Points"}, ["chi"] = {np = 3, vl = 2, nm = "Chi Points"}, ["teste"] = {np = 5, vl = 1, nm = "teste Level"}, ["shield"] = {np = 4, vl = 1, nm = "Shielding Skill"}, ["sword"] = {np = 4, vl = 1, nm = "Sword Skill"}, ["axe"] = {np = 4, vl = 1, nm = "Axe Skill"}, ["club"] = {np = 4, vl = 1, nm = "Club Skill"}, ["distance"] = {np = 4, vl = 1, nm = "Distance Skill"}, } if (param == "check") then doPlayerPopupFYI(cid, "~*~*~ Level Points System ~*~*~\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574) .."\nPoints per lvl: ".. VocPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (attributes[p2[2]]) and (tonumber(p2[3])) then if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * attributes[p2[2]].np) then doPlayerSendCancel(cid, "You do not have enough points to distribute!") return doSendMagicEffect(getThingPos(cid), 2) end if (p2[2] == "life") then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddHealth(cid, attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "chi") then setCreatureMaxMana(cid, getCreatureMaxMana(cid) + attributes[p2[2]].vl * tonumber(p2[3])) doCreatureAddMana(cid, attributes[p2[2]].vl * tonumber(p2[3])) elseif (p2[2] == "teste") then if getPlayerVocation(cid) == 5 then doPlayerSendCancel(cid, "Você n precisa desse atributo!") return false end doPlayerAddMagLevel(cid, attributes[p2[2]].vl * tonumber(p2[3])) elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do doPlayerAddSkillTry(cid, skillids[p2[2]], getPlayerRequiredSkillTries(cid, skillids[p2[2]], getPlayerSkillLevel(cid, skillids[p2[2]]) + 1) - getPlayerSkillTries(cid, skillids[p2[2]]), false) end end doSendMagicEffect(getThingPos(cid), 29) doSendMagicEffect(getThingPos(cid), 30) doSendAnimatedText(getThingPos(cid), "-" .. tonumber(p2[3]) * attributes[p2[2]].np, 180) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np) else local msgx = "" for i, v in pairs(attributes) do local add = (v.np > 1) and "s" or "" msgx = msgx .. v.vl .. " " .. v.nm .. " = " .. v.np .. " point" .. add .. "\n" end doPlayerPopupFYI(cid, "~*~*~ Level Points System ~*~*~\n\nNecessary points to increase the stats:\n\n".. msgx .. "\n\n\nAvailable Points: ".. getPlayerStorageValue(cid, 14574)) end return true endcomo posso fazer um item q de pontos para eu poder destribuir em skills?