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

How do you make that when you put a correct word in a textbox you get xp?

Asked by 7 years ago

i have tried this.

if script.Parent.Text == "while true do" then game.Players.plr.IntValue.Value = 25 end

2 answers

Log in to vote
-1
Answered by 7 years ago
Edited 7 years ago
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer

uis.InputBegan:connect(function(key)
if key.KeyCode == Enum.KeyCode.Enter then
if script.Parent.Text == "I Luv XP" then
player.XP.Value = player.XP.Value + 25
end
end
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.

0
ok now how do you make it insert a xp box in the leaderboard could you tell me with the other script in it Hugo_XPGamer 8 — 7y
Ad
Log in to vote
2
Answered by 7 years ago

Just use the FocusLost event of textboxes.

TextBox.FocusLost:Connect(function()
    if TextBox.Text == "" then

    end
end)

Answer this question