Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't my leaderstat go up?

Asked by 10 years ago

This is in a local script, but it sort of needs to be in a local script so I'm confused what to do. is it the square brackets? Please help.

01--Your wins.
02local yw = game.Players.LocalPlayer.leaderstats.Wins.Value
03--Your losses.
04local yl = game.Players.LocalPlayer.leaderstats.Losses.Value
05--Button.
06local button = script.Parent["Flip a card"]
07--Your Move.
08local ym = script.Parent["Your move"]
09--Their Move.
10local tm = script.Parent["Their move"]
11--Winner board.
12local wb = button.Label
13 
14 
15--Function for button.
View all 36 lines...

When I put it into a Normal script and modded it it still wouldn't work

01--Your wins.
02local yw = script.Parent.Parent.Parent.Parent.leaderstats.Wins.Value
03--Youre losses.
04local yl = script.Parent.Parent.Parent.Parent.leaderstats.Losses.Value
05--Button.
06local button = script.Parent["Flip a card"]
07--Your Move.
08local ym = script.Parent["Your move"]
09--Their Move.
10local tm = script.Parent["Their move"]
11--Winner board.
12local wb = button.Label
13 
14 
15--Function for button.
View all 36 lines...

1 answer

Log in to vote
1
Answered by
Tkdriverx 514 Moderation Voter
10 years ago

It's probably because the values don't even exist. Use a LocalScript. If you have a script (server Script) adding them, try using game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Wins"), etc. Also, remove the .Value and re-add it where you're trying to set the values (yw = yw + 1 to yw.Value = yw.Value + 1). This will actually set the values of them.

Ad

Answer this question