How do i get a leaderstat value and add value TO that? (SOLVED)
Asked by
6 years ago Edited 6 years ago
Im trying to make a "Twitter code" that give $300 but I cant figure out how to get the leaderstats and add the money, the leaderboard is already set up with the name Cash and the code script set up, i just dont know how to get the players Cash value and add more value to that. The code of question is FreeMolla
01 | CodeWork = "Code accepted" |
02 | CodeBox = script.Parent.Parent.Code_Box |
03 | ScreenText = script.Parent.Parent.Parent.GUI_TEXT |
04 | CodeBad = "Code denied" |
05 | script.Parent.MouseButton 1 Click:Connect( function (player) |
06 | if script.Parent.Parent.Code_Box.Text = = "NoChristmas" then |
07 | script.Parent.Parent.Code_Box.Text = "Code accepted :(" |
08 | script.Parent.Parent.Parent.GUI_TEXT.Text = "Yea, it took forever to get thanksgiving update done (Throughout halloween) so i just wont have time! SORRY! Also good job with my hint!" |
09 | script.Parent.Parent.Parent.GUI_TEXT.Visible = true |
11 | script.Parent.Parent.Parent.GUI_TEXT.Visible = false |
13 | if script.Parent.Parent.Code_Box.Text = = "DoubleCodes" then |
14 | script.Parent.Parent.Code_Box.Text = CodeWork |
17 | if CodeBox.Text = = "CODESSSS!" then |
18 | CodeBox.Text = CodeWork |
19 | ScreenText.Text = "DM MrGretto 2572" |
20 | ScreenText.Visible = true |
22 | ScreenText.Visible = false |
24 | if CodeBox.Text = = "FreeMolla" then |
25 | game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 300 |
26 | CodeBox.Text = CodeBox |
28 | CodeBox.Text = CodeBad |