1 | function die() |
2 | if game.Players.LocalPlayer.leadstats.Money.Value = 10 then |
3 | print ( "keem" ) |
4 | end |
5 |
6 |
7 | script.Parent.MouseButton 1 Down:connect(die) |
Output: Players.Player1.PlayerGui.ScreenGui.TextButton.LocalScript:2: 'then' expected near '='
You forgot the end. Also, you have to use "==" on if statements. Using a "=" will make the code think that it's supposed to set a value.
Also, learn how to organize your code, it makes it easy to read, and harder to get lost. See this article:
http://wiki.roblox.com/index.php?title=Writing_Clean_Code
1 | function die() |
2 | if game.Players.LocalPlayer.leadstats.Money.Value = = 10 then |
3 | print ( "keem" ) |
4 | end |
5 | end |
6 |
7 |
8 | script.Parent.MouseButton 1 Down:connect(die) |