Help on script [leaderstats]

Hi, I’m trying to make a level-up system so when a player’s exp hits something they earn a level. But the output says that leaderstats is not a member of Players. I am still new to RemoteEvents with Server to Client and I’m not sure if there is a problem with me calling the player or parameters. Anyone have any solutions?

2 Likes

Try using WaitForChild() instead of giving the path directly. This will pause the script until ‘leaderstats’ exists. Or, you never actually created a folder in the player.

2 Likes

In your function, you’re using the service Players instead of the player you have as a parameter.
Also, if your goal is to update the leaderstats value, you can’t do that in a client script and have it show up for everyone else.

5 Likes

check your script You put Players.leaderstats not player.leaderstats

btw this is similar to the above reply but much eaiser to understand

1 Like

Line 9 to 11, you used “Player” instead of “player”

2 Likes

This person right here got it right!

1 Like

trey using Player = game.Players.LocalPlayer

1 Like

all is wrong with this script lol

Just add .LocalPlayer at the end of local Player = game.Players

1 Like

@0000000000000102000 @joso555 its a script not local script

1 Like

yeah, it is the on client event only can run via local script ._.

oh ok now i get it but my solution also works dosent it?

1 Like

i dont think soooooooooooooooo

i guess it wont work not i will never get a solution from a topic

1 Like

oh yea btw if you have problems for leaderstats its an easy fix, and changing the values from client aint gonna work so use a serverscript you dont need a useless remote its exploitable

1 Like

if you cant fix it then your terrible at scripting

I’m sorry but this is coming from the man who couldn’t even tell if the script is a local script or a normal script, even though ‘OnClientEvent’ is client only. No offense.

On top of the Player variable needing to refer to the LocalPlayer, you can’t add to values on the client, you have to do it one the server either through remote events or remote functions.

1 Like

Change the paramter at the top to

local Player = game.Players.LocalPlayer

And .OnClientEvent does NOT have the player as a parameter, just use the one at the top as your player.

1 Like

i think the error message is false the “worst” scripter migjt but OnclientEqvrnt not OnSercerEvent

1 Like