Skip to content

SetXPRate

Sets how much of the XP the game awards on its own the players gain.

The game awards XP by itself - a kill, a hit, a distance walked, a book read - and the server gives none of it unless a mode says so: the rate is 0 when the server starts. rate is a multiplier: 1 is the game’s own amounts, 2 double, 0.5 half, 0 none, up to 100. It applies to every player now and to everyone who joins, except a player with a rate of their own (SetPlayerXPRate). Set it in OnGameModeInit.

It governs only the awards the game makes. XP the mode hands out (AddPlayerStatXP, AddPlayerSkillXP) and the levels it sets are unaffected. With OnPlayerGainXP defined every award reaches it already multiplied by the rate; at 0 none does.

SetXPRate(rate)
Parameter Type
rate number 0 .. 100; 1 = the game’s own

boolean - false for a rate outside 0..100 or not a number

function OnGameModeInit()
SetXPRate(1) -- the game's own XP: a kill, a book, a long walk all count
end

GetXPRate · SetPlayerXPRate · OnPlayerGainXP · AddPlayerSkillXP · the Stats, skills, XP and perks group of the index