Other
You should always make sure that you are calling these events after the rcore_stats script is initialized.
To make sure, check the Step 1 in the Integration guide.
Open UI
If you want to open the UI for example from some target script, you can use this event (this is CLIENT SIDE):
TriggerEvent('rcore_stats:api:openUI')Achievement unlocked event
If you want to for example give a reward to the player when they unlock an achievement, you can do it like this.
CLIENT SIDE:
AddEventHandler('rcore_stats:api:achievementUnlocked', function(achievementKey)
if achievementKey == "basket_hoops_1" then
-- Give the player a reward because they shot their first hoop in basketball
end
end)or
SERVER SIDE
AddEventHandler('rcore_stats:api:achievementUnlocked', function(playerId, achievementKey)
if achievementKey == "basket_hoops_1" then
-- Give the player with playerId a reward because they shot their first hoop in basketball
end
end)Stat value getter
If you want to get the value of the stat type for the player, you can do it like this (this is CLIENT SIDE):
As event:
As export:
Last updated
Was this helpful?