1 | local player = game.Players.LocalPlayer |
2 |
3 | while wait() do |
4 | if script.Parent.Text = = "Code" then |
5 | player.Points.Value = player.Points.Value + 100 |
6 | end |
7 | end |
I have this inside a LocalScript and I would of liked it to check if the Text == "Code" then to give the player who entered that code to get 100 points. I have tried many ways, but this looks like the closest. Anyone please help?
1 | local player = game.Players.LocalPlayer |
2 |
3 | script.Parent.FocusLost:connect( function (enterPressed) |
4 | if enterPressed and script.Parent.Text = = "Code" then |
5 | player.Points.Value = player.Points.Value + 100 |
6 | end |
7 | end ) |
The enterPressed will return true if enter is pressed to lose focus.