Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get a TextBox Text working?

Asked by 9 years ago
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

Log in to vote
2
Answered by
SirNoobly 165
9 years ago
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.

0
What's Filtering Enabled? NinjoOnline 1146 — 9y
0
It's a way to stop people using cheat engine. http://wiki.roblox.com/index.php?title=FilteringEnabled SirNoobly 165 — 9y
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? NinjoOnline 1146 — 9y
Ad

Answer this question