TextBox not changing text

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)
2 Likes

Are you using a local script or a script?

As you can see I did write something in the textBox, the text property still says Player’s Name though.

User Inputs don’t replicate to a script, use a local script then fire a RemoteEvent.

4 Likes

Well but ClickDetectors don’t work with Local Scripts.

That’s false, as stated here.

ClickDetector allows Scripts and LocalScripts to receive pointer input on 3D objects through their MouseClick event.

1 Like