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. |
02 | local yw = game.Players.LocalPlayer.leaderstats.Wins.Value |
03 | --Your losses. |
04 | local yl = game.Players.LocalPlayer.leaderstats.Losses.Value |
05 | --Button. |
06 | local button = script.Parent [ "Flip a card" ] |
07 | --Your Move. |
08 | local ym = script.Parent [ "Your move" ] |
09 | --Their Move. |
10 | local tm = script.Parent [ "Their move" ] |
11 | --Winner board. |
12 | local wb = button.Label |
13 |
14 |
15 | --Function for button. |
When I put it into a Normal script and modded it it still wouldn't work
01 | --Your wins. |
02 | local yw = script.Parent.Parent.Parent.Parent.leaderstats.Wins.Value |
03 | --Youre losses. |
04 | local yl = script.Parent.Parent.Parent.Parent.leaderstats.Losses.Value |
05 | --Button. |
06 | local button = script.Parent [ "Flip a card" ] |
07 | --Your Move. |
08 | local ym = script.Parent [ "Your move" ] |
09 | --Their Move. |
10 | local tm = script.Parent [ "Their move" ] |
11 | --Winner board. |
12 | local wb = button.Label |
13 |
14 |
15 | --Function for button. |
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.