local player = game.Players.LocalPlayer while wait() do if script.Parent.Text == "Code" then player.Points.Value = player.Points.Value + 100 end 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?
local player = game.Players.LocalPlayer script.Parent.FocusLost:connect(function(enterPressed) if enterPressed and script.Parent.Text == "Code" then player.Points.Value = player.Points.Value + 100 end end)
The enterPressed will return true if enter is pressed to lose focus.