Hi I have a Gui button that I want the player to teleport to a part when click. But it doesn't work. I have tried putting the teleport script in the Gui button. It didn't work so I tried to send a remote event to severscriptservice to teleport the player still don't work. The remote event is named TP and the scripts are just scripts. Gui button script:
script.Parent.MouseButton1Click:Connect(function(player) game.ReplicatedStorage.TP:FireClient() end)
ServerScriptService Script:
game.ReplicatedStorage.TP.OnServerEvent:Connect(function(player) player.Character.HumanoidRootPart.Position = workspace.CarSpawnPlayer.Position end)
player.Character.HumanoidRootPart.CFrame = workspace.CarSpawnPlayer.CFrame
you need to use CFrame when moving humanoids because they have all these Motor6Ds and attachments, joints, moving Position won't update the constraints which will kill the humanoid i think or just won't move it... also you have a typo i guess:
game.ReplicatedStorage.TP:FireClient() -- ^^^ noe game.ReplicatedStorage.TP:FireServer()
i don't know for sure but i think you don't even need the remote event since specially applies to humanoid, moving humanoid locally will replicate it to all other players automatically.