AMOUNT_PER_KILL = 25 //Amount of EXp you get per kill
function GM:PlayerInitialSpawn(ply)
ply:SetPData("Level", 0)
ply:SetPData("EXP", 0)
end
function ONNpcDeath(ply)
ply:SetPData(ply:GetPData("EXP") + AMOUNT_PER_KILL))
end
function LevelUp(ply)
if ply:GetPData("EXP") == 100 then
ply:SetPData("Level", 2)
ply:ChatPrint("You are now level 2! Congrats!!!!!")
//elseif --Continue this Im too lazy to write the rest -.-"
end
end
hook.Add("OnNPCDeath", "LevelUpLOL", LevelUp)
This is kinda of a basic idea of a level system. Pretty crappy but hey it works ^_^. Only thing I could come up with in 5 minutes...
Use LUA Box please.
AMOUNT_PER_KILL = 25 //Amount of EXp you get per kill
function GM:PlayerInitialSpawn(ply)
ply:SetPData("Level", 0)
ply:SetPData("EXP", 0)
end
function ONNpcDeath(ply)
ply:SetPData(ply:GetPData("EXP") + AMOUNT_PER_KILL))
end
function LevelUp(ply)
if ply:GetPData("EXP") == 100 then
ply:SetPData("Level", 2)
ply:ChatPrint("You are now level 2! Congrats!!!!!")
//elseif --Continue this Im too lazy to write the rest -.-"
end
end
hook.Add("OnNPCDeath", "LevelUpLOL", LevelUp)