How to script a gate, that slides? I have no clue how to script which explains why I decided to ask the question 'Sliding Gate | Script Requested'
If you can provide me with a script that will cover both gates, thank you.
How to script a gate, that slides? I have no clue how to script which explains why I decided to ask the question 'Sliding Gate | Script Requested'
If you can provide me with a script that will cover both gates, thank you.
local trigger = script.Parent
local gate = script.Parent
moving = false
open = false
function onClick()
if open == false and moving == false then
moving = true
for i = 1, (gate.Size.Y * 12 + 6) do
wait()
gate.CFrame = gate.CFrame*CFrame.new(-0.1, 0, 0)
end
moving = false
open = true
wait(2)
moving = true
for i = 1, (gate.Size.Y * 12 + 6) do
wait()
gate.CFrame = gate.CFrame*CFrame.new(0.1, 0, 0)
end
moving = false
open = false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
------------------------------------------------------------------------------------------
Place this inside your door along with inserting a click detector and you have a fully fledged and functional sliding door
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
wtf?
You are requesting which is not allowed.