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)
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)