Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my teleport pad not working properly?

script.Parent.Touched:Connect(function(part)
   local hum = part.Parent:FindFirstChild("HumanoidRootPart")
   hum.Position = game.Workspace:WaitForChild("Teleport2")
   wait(5)
end)

There are two problems with the script above. First,you teleport you teleport to where your meant to be but your body is halfway in the baseplate. I know why it's happening but I don't now how to fix it(it changes the hum position, which is the humanoid root part) to the ground. Secondly, the wait(5) dosen't work. All help would be appreciated!

1 answer

It will glitch when you change the position, so use the CFrame instead. Also use debounce when delaying something.

Script:

local debounce = false

script.Parent.Touched:Connect(function(part)
	if not debounce then
		debounce = true
		if part.Parent:FindFirstChild("Humanoid") then
		    local humRoot = part.Parent.HumanoidRootPart
		    humRoot.CFrame = game.Workspace:WaitForChild("Teleport2").CFrame + Vector3.new(0,2,0)

	    end
	    
	end
	wait(5)
	debounce = false
end)

5 comments

0

The debounce dosen't work and most of the script is wrong.

0

Excuse me? It worked in mine!

0

I was just trying to help you, man, the script has nothing wrong..

0

Maybe I do it a different way from you, but that doesn't mean I'm wrong!

0

Press "view source" then copy paste.

This discussion is preserved as it was. New answers, comments, and votes are closed.