Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Creaturescript] Reach x level get x points

Experienced Elementalist
Joined
Jul 29, 2012
Messages
240
Reaction score
25
Hello,
Someone requested this script and I made it.

Here is how it works, you get X level then you receive x Premium Point.

Add in creaturescript.xml
Code:
	<event type="advance" name="5points" event="script" value="5pts.lua"/>

I made it so it gives 5points at level 300
add 5pts.lua to /script
Code:
--- Created by Amiroslo----
local t = {}

local points = 5 -- amount of premium points

function onAdvance(cid, type, oldlevel, newlevel)
   if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
   if (newlevel >= 300 and getPlayerStorageValue(cid, 12345) == -1) then
        local p = "UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." where id="..getPlayerAccountId(cid)
                 db.executeQuery(p)
    doSendAnimatedText(pos, 'You have reached level 300 and you have received 5 Points!', RED)
    setPlayerStorageValue(cid, 12345, 1)
  end
  end
  return true
end
Change
if (newlevel >= 300
>>> to the level you want
and
local points = 5 -- amount of premium points

and in login.lua
Code:
	registerCreatureEvent(cid, "5points")

Rep++ if I helped you :D
 
Back
Top