HumanoidRootPart Teleport Help

hey there,
im working on a simulator game, and in my test game, im trying to make a teleport to sell button, but when it teleports, the player just sort of fuses with the ground but the camera stays put, here is the script:

local player = game.Players.LocalPlayer

local Character = player.Character

script.Parent.MouseButton1Click:Connect(function()
	Character.HumanoidRootPart.Position = Vector3.new(10,100,0)
end)
1 Like

First, make the teleport into a server script but have the button fire to a RemoteEvent in the ReplicatedStorage (Name it ToSellButton).

Client

local player = game.Players.LocalPlayer

local Character = player.Character

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.ToSellButton:FireServer()
end)

Server (Put script in ServerScriptStorage):

game.ReplicatedStorage.ToSellButton.OnServerEvent:Connect(function(player)
       player.Character.HumanoidRootPart.CFrame = CFrame.new(10,100,0)
       -- Change the position to above where the shop is and the player won't fuse with the ground
end)
2 Likes

okay thanks, will try that @Zombiefin

1 Like