local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local root = character:WaitForChild("HumanoidRootPart")
root.Position = Vector3.new(0, 10, 0)
end)
end)script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.TeleportEvent:FireServer()
end)game.ReplicatedStorage.TeleportEvent.OnServerEvent:Connect(function(player)
local character = player.Character
if character then
local root = character:FindFirstChild("HumanoidRootPart")
if root then
root.Position = Vector3.new(50, 5, 0)
end
end
end)local part = workspace.TeleportPart
local root = player.Character:WaitForChild("HumanoidRootPart")
root.CFrame = part.CFrame + Vector3.new(0, 5, 0)root.CFrame = CFrame.new(0, 10, 0)WaitForChild("HumanoidRootPart")