Im trying to make something that a script in a a teleporter will only work when someone does a certain thing, then I tested, opened output, then found this error, can someone please help me out.
Script:
local part = script.Parent
if game.PurpleKey.ClickDetector.MouseClick:Connect(function(plr) keyModule.Clicked = true wait(1) part:remove()
if game.PurpleKey.ClickDetector.MouseClick:Connect(function(plr) keyModule.Clicked = false wait(1) part:add()
end

1 comment
You need another end. Each if statement requires its own end.