Hello, I'm having some problems with TextBox. I'm making a teleport weapon using XYZ, you basically type into the TextBox the coordinates where you want to go. I think the problem is happening because the TextBox text is only changing on the client.
Here is the scripts:
Client:
local tool = script.Parent
local player = game.Players.LocalPlayer
tool.Equipped:Connect(function()
player.PlayerGui.Vector.TextBox1.Visible = true
player.PlayerGui.Vector.TextBox2.Visible = true
player.PlayerGui.Vector.TextBox3.Visible = true
end)
tool.Unequipped:Connect(function()
player.PlayerGui.Vector.TextBox1.Visible = false
player.PlayerGui.Vector.TextBox2.Visible = false
player.PlayerGui.Vector.TextBox3.Visible = false
end)
tool.Activated:Connect(function()
script.Parent.TeleportEvent:FireServer(player)
end)
Server:
script.Parent.TeleportEvent.OnServerEvent:Connect(function(player)
player.Character.HumanoidRootPart.Position = Vector3.new(player.PlayerGui.Vector.TextBox1.Text, player.PlayerGui.Vector.TextBox2.Text, player.PlayerGui.Vector.TextBox3.Text)
end)
By the way there are 3 TextBox. The first represents X, the second represents Y and the third represents Z.

2 comments
sorry i didn't know how to turn that into code
Did it for you. It's the Lua icon that is a code block