So i began by searching up scripting commands so i could attempt to do it myself (im pretty new at scripting). As i expected, i didnt really work at all :P However, i really wasnt too far off(i dont actually remember what i did since it was a bit ago and iv been trying to figure out exactly what was wrong with other attempts i tried even with a guide. (After probably a total of 3 frustrating hours of trying to do this simple task of moving a player, i eventually came here)
My most recent event involved looking up a video online of someone doing a teleport pad tutorial....which means it was tested and worked.... But it still didnt work.... I literally did EXACTLY what was in the video. I even created a brand new place just in case there was some bug or virus in my other places. Nope. Still didnt work.
here are the scripts i had, where my GREEN pad teleported right next to my RED pad:
GREEN PAD
script.Parent.Touched:connect(function(hit)) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.Torso.CFrame = CFrame.new(-173, 0.5, -43) end) end)
RED PAD
script.Parent.Touched:connect(function(hit)) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.Torso.CFrame = CFrame.new(-143, 0.5, 90) end) end)
PLEASE help me.... It is driving me crazy that i cant do this....
EDIT:
This is the script i actually have. Idk what happened, but the script above got a little messed up when i was copying/pasting them
script.Parent.touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.Torso.CFrame = workspace.RedPad.CFrame end
end)
You have some extra parentheses in your script on line 1 and 6.
Green Pad
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')~=nil then if hit.Parent:FindFirstChild("UpperTorso")~=nil then hit.Parent.UpperTorso.CFrame = CFrame.new(-173, 0.5, -43) elseif hit.Parent:FindFirstChild("Torso")~=nil then hit.Parent.Torso.CFrame = CFrame.new(-173, 0.5, -43) end end end)
Red Pad
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')~=nil then if hit.Parent:FindFirstChild("UpperTorso")~=nil then hit.Parent.UpperTorso.CFrame = CFrame.new(-143, 0.5, 90) elseif hit.Parent:FindFirstChild("Torso")~=nil then hit.Parent.Torso.CFrame = CFrame.new(-143, 0.5, 90) end end end)
If you want to teleport the player to the other pad just off to the side we can do this Green Pad
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')~=nil then if hit.Parent:FindFirstChild("UpperTorso")~=nil then hit.Parent.UpperTorso.CFrame = workspace.RedPad.CFrame + Vector3.new(3,0,0) elseif hit.Parent:FindFirstChild("Torso")~=nil then hit.Parent.Torso.CFrame = workspace.RedPad.CFrame + Vector3.new(3,0,0) end end end)
Red Pad
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')~=nil then if hit.Parent:FindFirstChild("UpperTorso")~=nil then hit.Parent.UpperTorso.CFrame = workspace.GreenPad.CFrame + Vector3.new(3,0,0) elseif hit.Parent:FindFirstChild("Torso")~=nil then hit.Parent.Torso.CFrame = workspace.GreenPad.CFrame + Vector3.new(3,0,0) end end end)
Try this script
local Debounce = false script.Parent.Touched:connect(function(Obj) if Debounce == false then Debounce = true if Obj:FindFirstChild("Humanoid") ~= nil then Obj.Parent.Torso.CFrame = game.Workspace.RedPad.CFrame + Vector3.new(3,0,0) end wait(2) Debounce = false end end)
Since R15 has been released, don't use Torso
or UpperTorso
, neither one is present and will work for both. The best practise is to use HumanoidRootPart
, this way it'll work for both flawlessly. Try this:
Green Pad
script.Parent.touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.HumanoidRootPart.CFrame = workspace.RedPad.CFrame+Vector3.new(0,2.5,0) end end)
Red Pad
script.Parent.touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.HumanoidRootPart.CFrame = workspace.GreenPad.CFrame+Vector3.new(0,2.5,0) end end)
If this has solved your problem, accept it as the answer. If it hasn't, comment below with any errors that occur.