I made a teleporter script, which teleports the person from one teleporter to another. It also has a debounce. When I tested it, it does not work. Is it my debounce, or what?

My script:

debounce = script.Parent.On
debounce2 = game.Workspace.Stage6.Tele1.On
script.Parent.Touched:connect(function(hit)
	if debounce.Value == true then
	if hit.Parent:FindFirstChild("Humanoid") ~= nil then
		hit.Parent:MoveTo(game.Workspace.Stage6.Tele1.Position)
		debounce.Parent.BrickColor = BrickColor.new("Bright red")
		debounce2.Parent.BrickColor = BrickColor.new("Bright red")
		debounce.Value = false
		debounce2.Value = false
		wait(2)
		debounce.Value = true
		debounce2.Value = true
		debounce.Parent.BrickColor = BrickColor.new("Really blue")
		debounce2.Parent.BrickColor = BrickColor.new("Really blue")
		end
	end
end)

8 comments

1

Are there any output errors?

0

It's just about some other stuff, but they still work. There's nothing on the teleporter script.

1

Try using the print function on some lines, see where they stop, and make sure all conditions of the if statements are coming back true.

0

Does not print ahead of line 6, but every variable is true. I'm assuming the debounce is the error?

0

HOLY GOD IM SO STUPID.

0

Your printing method worked. I found the mistake on line 7, where I changed the name of Humanoid so the player can't reset.

0

I gave u 1+ rep for your help.

0

Glad I can help ;-)