I tried making a tool that would teleport the player.
LocalScript:
local plr = game.Players.LocalPlayer script.Parent.Activated:Connect(function() local mouse = plr:GetMouse() game.ReplicatedStorage.tpPlr:FireServer(mouse.Hit.p) end)
server script:
game.ReplicatedStorage.tpPlr.OnServerEvent:Connect(function(client, mouseCFrame) local humanPart = client.Character.HumanoidRootPart humanPart.CFrame = mouseCFrame end)
It said that a CFrame was expected, but got a Vector3. Anyone know the problem?
I recommend Using :MoveTo() as the player is a model and this ensures the player does not fall through the ground without any extra code here is an example of how to use it.
game.ReplicatedStorage.tpPlr.OnServerEvent:Connect(function(client, mouseCFrame) local Character = workspace:WaitForChild(client.Name) Character:MoveTo(mouseCFrame) end)