when a button is clicked on the gui i need the player to tp to a location
heres the local script under the button:
script.Parent.MouseButton1Click:Connect(function() local locationofred = game.Workspace.RedSpawn.CFrame game.ReplicatedStorage.Teleporter:FireServer(locationofred) end)
here is the server script after the event is fired:
game.ReplicatedStorage.Teleporter.OnServerEvent:Connect(function(player, location) local playerlocation = player.Character.HumanoidRootPart.CFrame local partlocation = location playerlocation = CFrame.new(partlocation) end)

3 comments
Also take note of the way I set the CFrame
Bro thanks so much it finally works now!
No problem bro