Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Where is the problem in my script? [SOLVED]

Asked by
obcdino 113
8 years ago

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)
1
Are there any output errors? M39a9am3R 3210 — 8y
0
It's just about some other stuff, but they still work. There's nothing on the teleporter script. obcdino 113 — 8y
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. M39a9am3R 3210 — 8y
0
Does not print ahead of line 6, but every variable is true. I'm assuming the debounce is the error? obcdino 113 — 8y
View all comments (4 more)
0
HOLY GOD IM SO STUPID. obcdino 113 — 8y
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. obcdino 113 — 8y
0
I gave u 1+ rep for your help. obcdino 113 — 8y
0
Glad I can help ;-) M39a9am3R 3210 — 8y

Answer this question