-- Replace these values with the position where you want to teleport the player local destinationPosition = Vector3.new(10, 5, 20) -- Function to teleport the player to the destination position local function teleportPlayer(player) if player.Character then player.Character:MoveTo(destinationPosition) end end -- Replace 'ScriptParent' with the object that contains this script script.Parent.Touched:Connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then teleportPlayer(player) end end)
inside of studio instead of teleporting you get HTTP Error 403, so you have to rename it to either "How to teleport players in Roblox" or "How to get HTTP Error 403 in Roblox Studio"
Yay! A Pluto upload, btw could you maybe make another video like making a realistic horror game. It was very fun to watch and it got a lot of attention.
I am seeing a lot of people having errors in this comment section, that's why I will leave this other script that might help someone, instead of using the ":MoveTo()" function, we are going to use ":SetPrimaryPartCFrame()" instead. Lets imagine that we have a BasePart somewhere around the map, and that our character haves a Primary Part (if its the player normal roblox avatar then the primary part is the head, if its a custom character of your game then you need to set the primary part of the model to the head for this script to work). Lets also pretend that your character will teleport if he clicks either a TextButton or an ImageButton of any ScreenGui This is how the script would look: local player = game.Players.LocalPlayer.Character local button = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton local teleportbrick = game.Workspace.Part button.MouseButton1Click:Connect(function() player:SetPrimaryPartCFrame(teleportbrick) end) I hope this comment will help people in their projects ^^
@@B0unty0What do you mean by faster? I don't see a difference between SetPrimaryPartCFrame(cframe) and :MoveTo() really, do you mean the amount of time it takes to the player to teleport or what?
Place any part where you want the players to teleport to, go to the properties of the part and copy the coordinates of the part origin, you can delete the part later if needed
To find coords in roblox studio do this: Insert a part on where u want the player to be teleported Add a script to the part then write this Local part = script.Parent Print(part.Position) Run the game and in the output it will show u the position of the part Copy the position and add it to the local script in the video Ur welcome;)
A local script runs off the client meaning, it can easily get the player instance however the server needs a remote event to get that same player instance. Use a local script in starter gui.
Free script Workspace add part: script.Parent.Touched:Connect(function(Hit) if Hit and Hit.Parent:WaitForChild("Humanoid") then local Player = game.Player:GetPlayerFromCharacter(Hit.Parent Player ) Player.Character:MoveTo(Vector3).new(0,0,0)) end end) StarterGui add localplayer: local Player = game.Player.LocalPlayer.Character Player:MoveTo(Vector3).new(0,0,0))
Please make more tutorials!! You make them so simple and easy to follow!!
-- Replace these values with the position where you want to teleport the player
local destinationPosition = Vector3.new(10, 5, 20)
-- Function to teleport the player to the destination position
local function teleportPlayer(player)
if player.Character then
player.Character:MoveTo(destinationPosition)
end
end
-- Replace 'ScriptParent' with the object that contains this script
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
teleportPlayer(player)
end
end)
bro thank u the other script wasnt working
inside of studio instead of teleporting you get HTTP Error 403, so you have to rename it to either
"How to teleport players in Roblox"
or
"How to get HTTP Error 403 in Roblox Studio"
you cant script then
Yay! A Pluto upload, btw could you maybe make another video like making a realistic horror game. It was very fun to watch and it got a lot of attention.
i'll think about it...
you should open-source that game, it can be expanded by anyone further, also yes your horror game videos are fun to watch.@@PlutoIsAway
@@PlutoIsAway I love you.
AND PLUTO MADE THE HORROR GAME🎉
Yay he is back!
and i love your videos
I am seeing a lot of people having errors in this comment section, that's why I will leave this other script that might help someone, instead of using the ":MoveTo()" function, we are going to use ":SetPrimaryPartCFrame()" instead.
Lets imagine that we have a BasePart somewhere around the map, and that our character haves a Primary Part (if its the player normal roblox avatar then the primary part is the head, if its a custom character of your game then you need to set the primary part of the model to the head for this script to work). Lets also pretend that your character will teleport if he clicks either a TextButton or an ImageButton of any ScreenGui
This is how the script would look:
local player = game.Players.LocalPlayer.Character
local button = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton
local teleportbrick = game.Workspace.Part
button.MouseButton1Click:Connect(function()
player:SetPrimaryPartCFrame(teleportbrick)
end)
I hope this comment will help people in their projects ^^
thanks mate
thank you
Pls answer me! HI i watched ur viewmodel tutorial and i am making a hunting game how do i make animations for it? Btw i need the gun in the animation
Quick question, Why not Character:SetPrimaryPartCFrame(cframe)?
because :MoveTo() is faster, you can also do Hit.Parent.HumanoidRootPart.Position = vector3.new(0,0,0)
@@B0unty0What do you mean by faster? I don't see a difference between SetPrimaryPartCFrame(cframe) and :MoveTo() really, do you mean the amount of time it takes to the player to teleport or what?
Hello Bro can you make a gas if you go to a gas you will like -10 - 10 but if you go with mask tool it will be good pls?
for some reason the game wasn't able to get Player.Character with any other code but this works... 5/5 tutorial i guess xd
How do you find coords in studio? like I know how to teleport people now but how do I find the coords that I need to teleport them to?
Place any part where you want the players to teleport to, go to the properties of the part and copy the coordinates of the part origin, you can delete the part later if needed
can u help me scripting how to teleport players if u toutch a part? because mine didn't works...
TYSM I NEED IT
Unfortunately, this will not work for Front View / Laser tag template. Since it's not a third person view.
It gave a bug on the first part of your video: Workspace.Ignore:5: attempt to index nil with 'Character' and i am going insane over it
Same!
Thank you
How do you find coords in roblox studio?
To find coords in roblox studio do this:
Insert a part on where u want the player to be teleported
Add a script to the part then write this
Local part = script.Parent
Print(part.Position)
Run the game and in the output it will show u the position of the part
Copy the position and add it to the local script in the video
Ur welcome;)
Thank you so much 🫶@@ThatBannanaGuy69420
TYSM
bruh, got into the wrong vid, i dont wanted some where INSIDE the game, i was meant to go to some where OUTSIDE the game 🤣😂😂😂😂😂😂
dude i am a 12 year old
and i love ur videos pls send more videos i really want to be like pro developer like u
if want to be pro dev
don't follow tutorials unless ur stuck on something, even then try to use the tutorial as a guide as much as possible
this doesn't work you can't put LocalPlayer after Players
you can but not in a server sided script
@@Jxhsxn yeah pretty sure that's what I meant
A local script runs off the client meaning, it can easily get the player instance however the server needs a remote event to get that same player instance. Use a local script in starter gui.
@@jaivierbirring9757 k
Free script
Workspace add part:
script.Parent.Touched:Connect(function(Hit)
if Hit and Hit.Parent:WaitForChild("Humanoid") then
local Player = game.Player:GetPlayerFromCharacter(Hit.Parent Player )
Player.Character:MoveTo(Vector3).new(0,0,0))
end
end)
StarterGui add localplayer:
local Player = game.Player.LocalPlayer.Character
Player:MoveTo(Vector3).new(0,0,0))