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

What's wrong with this sliding door script? i get nothing in output and door does nothing

newbie here, im trying to make a sliding door but i don't know what's wrong.

gate = script.Parent.Parent.Gate
active = script.Parent.Parent.Bool
condition = script.Parent.Parent.Condition
function onClick()
	if active.Value == true then
		if condition.Value == false then
			active.Value = false
			print("opening...")
			for i = 1, 28 do
				gate.Position = gate.Position + Vector3.new(0.5, 0, 0)
				wait(.1)
			end
			condition.Value = true
			active.Value = true
		else
			active.Value = false
			print("closing...")
			for i = 1, 28 do
				gate.Position = gate.Position - Vector3.new(0.5, 0, 0)
				wait(.1)		
			end
			condition.Value = false
			active.Value = true
		end
	end	
end

script.Parent.ClickDetector.MouseClick:connect(onClick()

1 answer

This might not be helpful, but try putting prints at some places, if it doesnt print thats where its wrong

4 comments

0

Good idea, thanks.

0

wait do you want a sliding door or a door that just opens like teleporting to a new position? cuz if its teleportation i can do it C:

0

i made a model for it, its rlly different but feel free to use it :D

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