Documentation
All real-time Rank and XP data are stored in statebags!
-- Get Rank
LocalPlayer.state.rank
-- Get XP
LocalPlayer.state.xp
-- Get Rank
Player(PlayerId).state.rank
-- Get XP
Player(PlayerId).state.xp
exports["OnlineM-XP"]:addXP(PlayerId, Amount)
Gets the rank the user will recieve if they recieve a certain amount of XP
exports["OnlineM-XP"]:getNextAvailableRankUp(currentRank, XPamount)
You Can Easily give a player XP by using state bags!
Player(PlayerId).state.addXP(amount)
exports["OnlineM-XP"]:removeXP(PlayerId, Amount)
Gets the rank the user will recieve if they loose a certain amount of XP
exports["OnlineM-XP"]:getNextAvailableRankDown(currentRank, XPamount)
You Can Easily remove XP from a player by using state bags!
Player(PlayerId).state.removeXP(amount)
You Can show the XP bar Using the
showBar
export or theonlineM-xp:showBar
event
Argument | Data Type | Optional | Default Value | Explanation |
---|---|---|---|---|
Duration | number | Yes | 5000 | The Time in milliseconds that it shows on the screen |
speed | number | Yes | 1000 | The Animation Speed in milliseconds |
BarText | String | Yes | Current XP | The Text to show under the Bar |
exports["OnlineM-XP"]:showBar(Duration, speed, BarText)
-- for default bar:
exports["OnlineM-XP"]:showBar()
TriggerEvent("onlineM-xp:showBar", Duration, speed, BarText)
-- for default bar:
TriggerEvent("onlineM-xp:showBar")