Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to get a TextBox Text working?

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?

1 answer

✓ Accepted answer
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.

3 comments

0

What's Filtering Enabled?

0

It's a way to stop people using cheat engine. http://wiki.roblox.com/index.php?title=FilteringEnabled

0

ok, cool and works :D Thanks. Is it possible to make it so once the COde has been entered they cant enter the same thing over and over?

This discussion is preserved as it was. New answers, comments, and votes are closed.