Script reverting

Hello, my name is willo.

I keep having problems figuring out how to stop a script reverting by it’s self. I am pretty new, and getting in to scripting. Could anyone help me?

The error I get is: Cash is not a valid member of Folder

And this is the line: player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + reward
Even tho I have wrote it as “Cash” it still gives me an error sometimes that it’s called bucks.

Thanks for passing by!

You could try doing leaderstats:WaitForChild("Cash"), just in case it hasn’t loaded in yet

In the script? ---------------

Yes you would do it in the script

Ok thanks, ill let you know if anything is wrong after woods.

Can I see your entire script? (30 chars)

Sure! Is there any way I can dm you?

You should probably post it here, so other people can see the script too.

local player = game:GetService("Players").LocalPlayer

player.leaderstats:WaitForChild("Cash").Value = player.leaderstats:WaitForChild("Cash").Value + reward

This should work…

Possibly try to make it so the leaderstats load first so something like this, i don’t know if this would change anything though.

local player = game:GetService("Players").LocalPlayer

player:WaitForChild("leaderstats").Cash.Value = player:WaitForChild("leaderstats").Cash.Value + reward
1 Like

Also, is this in team create?

30 characters

The leaderstats folder is loading tho.

you mentioned it’s giving an error that it’s called bucks was it previously named bucks in the script itself? And is this place in team create?

1 Like

Why would it called sometimes bucks? maybe you got 2 leaderstats?

He probably made a mistake while making the leaderboards

1 Like

Yes it was named bucks before.