Can someone help me? I made a script but its not working:
COMMUNITY QUESTION
How do i make a script that when you touch a part you teleport to another part?
1 answer
Well i understand your question but then i looked at your screenshot and I didn't understand what you were doing so im just gonna tell you how to change the position of the player
well first you want to set a variable
local teleto = game.workspace.part -- that an example of where the part is located in game explorer
well now that that is done we need to get the actual teleporting done Assuming that the script is located within the part that teleports you this is how i would teleport the player
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild('humanoid') then
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(teleto.position)
end
end)
2 comments
0
Ahh i loke how you looked for the Humanoid to identify if the hit is a character, also CFrames are better too! Even though changeing position works too
0
Yes, use Dream's code am a' delete my ugly code ;-;
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
You can copy and past the code into your question after hitting the blue lue button
I'm not good at it :P
When you call the function, you can't feed it 3 perimeters if you only gave it one.