Hello! So I’m currently making a Hand-To Gui but for some reason the TextBox is not changing it’s text.
The default text is Player’s Name and even though I do write something in the textBox, the text just does not change.
I’ve printed the name and it says “Player’s”
playerGui.Register.Frame.TextButton.MouseButton1Click:Connect(function()
print("Click")
--He clicked the done button so he probably did write something as name
local splits = playerGui.Register.Frame.TextBox.Text:split(" ")
local name = splits[1]
--Search the name now
for i,v in pairs(game.Players:GetChildren()) do
print("loop")
print(name)
if v.Name:sub(1, name:len()):lower() == name:lower() then
print("Correct player found")
--v is the correct player
--Find the tool
local function FindTool(char)
for i,v in pairs(char:GetChildren()) do
if v:IsA("Tool") then
print(v)
return v
end
end
end
local tool = FindTool(plr.Character)
print("tool var")
if tool then
print("There is a tool")
--If there is a tool then give it to the player
local clone = tool:Clone()
tool:Destroy()
clone.Parent = v.Character
--Give the player a point
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value
print("Yes")
end
end
end
end)