i want players to get points in certain lvl like 160 20 point u know?Do you want the players to get points per level? Or are you asking for a points command script (for example /addpoints)
-- Author: Kahras // TIBIA.NET.PL \\ Help: Matt --
[*]function onAdvance(cid, skill, oldLevel, newLevel)
[*]-- [level] = {give = "yes/no", itemid = iditem, count = count, storage = storage}
[*]local poziomy = {
[*][50] = {give = "no", itemid = id of item who give premium points, count = 1, storage = 350001},
[*][100] = {give = "yes", itemid = id of item who give premium points, count = 2, storage = 350002},
[*][150] = {give = "yes", itemid = id of item who give premium points, count = 3, storage = 350003},
[*][200] = {give = "no", itemid = id of item who give premium points, count = 5, storage = 350004}
[*]}
[*]for k, v in pairs(poziomy) do
[*]if getPlayerStorageValue(cid, v.storage) == -1 then
[*]if(newLevel == k) then
[*]setPlayerStorageValue(cid, v.storage, 1)
[*]doBroadcastMessage("Player "..getPlayerName(cid).." advanced on level "..newLevel.." !\n Congratulations!")
[*]if(v.give) then
[*]v.give = getBooleanFromString(v.give)
[*]end
[*]if(not v.give) then
[*]return false
[*]end
[*]doPlayerAddItem(cid, v.itemid, v.count)
[*]end
[*]end
[*]end
[*]return TRUE
[*]end
<event type="advance" name="pointsforlvl" event="script" value="points.lua"/>
local t, storage = {
-- level -- amount points (delete this line)..
{350, 50},
{450, 65},
{500, 275},
{600, 100},
}, 259
function onAdvance(cid, skill, oldLevel, newLevel)
if skill ~= SKILL__LEVEL then
return true
end
for i = 1, #t do
local v = t[i]
if newLevel >= v[1] and getCreatureStorage(cid, storage) < i then
db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))
doCreatureSetStorage(cid, storage, i)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Premium Points!')
end
end
return true
end
i will see,ThanksAdd this at creaturescripts.xml
Create a folder in the creaturescripts and name it points and add this in itCode:<event type="advance" name="pointsforlvl" event="script" value="points.lua"/>
Code:local t, storage = { -- level -- amount points (delete this line).. {350, 50}, {450, 65}, {500, 275}, {600, 100}, }, 259 function onAdvance(cid, skill, oldLevel, newLevel) if skill ~= SKILL__LEVEL then return true end for i = 1, #t do local v = t[i] if newLevel >= v[1] and getCreatureStorage(cid, storage) < i then db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid)) doCreatureSetStorage(cid, storage, i) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Premium Points!') end end return true end
not working
i got an errorAdd this at creaturescripts.xml
Create a folder in the creaturescripts and name it points and add this in itCode:<event type="advance" name="pointsforlvl" event="script" value="points.lua"/>
Code:local t, storage = { -- level -- amount points (delete this line).. {350, 50}, {450, 65}, {500, 275}, {600, 100}, }, 259 function onAdvance(cid, skill, oldLevel, newLevel) if skill ~= SKILL__LEVEL then return true end for i = 1, #t do local v = t[i] if newLevel >= v[1] and getCreatureStorage(cid, storage) < i then db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid)) doCreatureSetStorage(cid, storage, i) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Premium Points!') end end return true end
a screen shot of data/creaturescripts/scriptsdid you created the file with lua extension called points?
what u mean? give me an examplewell thats a txt document not lua
what u mean? give me an example
I did make it load,but when i reach the level i don't get points..well thats a txt document not lua
0.0.4what tfs r u using?