#How to reference player to update leaderboard

1 messages · Page 1 of 1 (latest)

pine geyser
#

Hello. I've been upgrading the "snake game basic scripting tutorial". Now I want to have a leaderboard that updates and tells the player how big their snake is. I've made a bindable event that fires when the apple is touched by the player but i'm having trouble properly referencing the player that has a folder in it so the leader stats can uptick. Can someone help me?

#

this is the code that fires the bindable event

glacial whale
#

@pine geyser no need for a bindable, you can directly get the player from the character in the apple script and do player.leaderstats.Size.Value += 1

#

Also, you cannot get game.Players.LocalPlayer on the server. That is client script exclusive

#

So I would completely delete the bindable and increase the leaderstat value in the script where you detect snake size increase on apple touch

pine geyser
#

so I'm attempting to just have the leaderstats update in the apple script but the arg for the function to activate is the character instead of the player. I'm having trouble trying to reference the player because i'm getting an error of "leaderstats is not a member of model "

glacial whale
pine geyser
#

didnt know you could refer to the player from the character