if script.Parent.Text == "while true do" then game.Players.plr.IntValue.Value = 25 end
01 | local uis = game:GetService( "UserInputService" ) |
02 | local player = game.Players.LocalPlayer |
03 |
04 | uis.InputBegan:connect( function (key) |
05 | if key.KeyCode = = Enum.KeyCode.Enter then |
06 | if script.Parent.Text = = "I Luv XP" then |
07 | player.XP.Value = player.XP.Value + 25 |
08 | end |
09 | end |
10 | end ) |
That will make it so when you press enter and the code is whatever you code is then it will give xp
Make sure it's in a local script in the textbox.
Just use the FocusLost
event of textboxes.
1 | TextBox.FocusLost:Connect( function () |
2 | if TextBox.Text = = "" then |
3 |
4 | end |
5 | end ) |