I need to know how to teleport a player after you speak to them in Roblox studio can someone please help me?
1
Help and Feedback Scripting Support
So I’m making a menu where I want the player to teleport to the house when he presses the play button in the menu but I don’t know how it’s done so I need your help 3 Likes
Character.HumanoidRootPart.CFrame = CFrame.new(1,5,9) -- you can change them 4 Likes
Create a RemoteEvent that the client will fire when it is clicked on. In the parameters, be sure to include the player. On a server script, receive the event and use the player instance that was sent and find it’s HumanoidRootPart in the workspace. Then move the player’s HumanoidRootPart to the house. Example: —Client, inside of button local plr = game.Players.LocalPlayer local workspaceplr = game.Workspace:FindFirstChild(plr.Name) local event = game.ReplicatedStorage.Event —You need to change this to the name of the RemoteEvent local button = script.Parent button.MouseButton1Click:Connect(function() event:FireServer(workspaceplr) end) —Server, anywhere basically local event = game.ReplicatedStorage.Event —You need to change this to the name of the RemoteEvent event.OnServerEvent:Connect(function(plr) plr.HumanoidRootPart.CFrame = CFrame.new(0, 0, 0) —Change this to the Position of where you want the player to go end)2 Likes
local teleportPart = -- the part that the character teleports to script.MouseButton1Click:Connect(function() game.Players.LocalPlayer.Character.HumanoidRootPart:MoveTo(teleportPart.Position) end) 2 Likes
I don’t think they asked for the player to move. They asked for the players character to be teleported. 2 Likes
u know how to script, don’t ya? it’s a script to teleport the character not the player 2 Likes
First of all, I believe you do this on the server? Second, :MoveTo() moves it, not teleports it. Here’s a video:
1 Like
But :MoveTo makes the character walk… 2 Likes
it makes it move only if u use it with the Humanoid not with the HumanoidRootPart @chubbypig332211 @soccervr edit; y’all should rly study harder lol 1 Like
place = CFrame.new(0,0,0) – Where you want the player to go on touched script.Parent.Touched:connect(function(p)–Creating the function local humanoid = p.Parent:findFirstChild(“Humanoid”)–Trying to find the humanoid if (humanoid ~= nil) then – Checking if what touched it IS a player. humanoid.HumanoidRootPart.CFrame = place – Moves the torso to what is specified in the place variable end end)–Ending the fuction, if you see on the function line above there is an unclosed parenthesis that I am closing here. 1 Like
That’s what you should use it for, the Humanoid, not HumanoidRootPart. Use CFrame.new for teleporting HumanoidRootPart. 1 Like
it didn’t work
1 Like
Did you do .MoveTo or :MoveTo? Also, please show what you just typed. 1 Like
1 Like
You need to find the workspace Player. Something like this: local plr = game.Players.LocalPlayer local workspaceplr = game.Workspace:FindFirstChild(plr.Name)1 Like
I have those as well 1 Like
ANRTNT:
Then do something like this: workspaceplr.character.humanoidrootpart:MoveTo(teleportPart.Position)1 Like
1 Like
MoveTo is a function of models, not parts, use Character:MoveTo(position) rather than Character.HumanoidRootPart:MoveTo(position) 1 Like
still the same error got before 1 Like next page →
Teleporting a player’s character to a different coordinate point — while maintaining the character’s structural makeup — is achieved by moving the character’s Humanoid/RootPart|RootPart. This article outlines a module-based approach with adjustable parameters. This article focuses on moving players within the same articles/games and places|place. To teleport players between places/levels in a multi-place game, see articles/Teleporting Between Places|Teleporting Between Places. Basic teleport functionality can be wrapped in a ModuleScript so that it can be called from other scripts.
Teleportation can be easily triggered when a player touches a part such as a teleporation pad or an invisible trigger part at a door’s entry point.
Because player teleportation should only be called on the game server, you’ll need to fire a articles/Remote Functions and Events|remote event alongside client-side actions like activation of a GUI button. The following setup outlines this process.
|