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

How do I make a model move when I click a brick?

Asked by 9 years ago

I know that there's ClickDetector, but I have a really basic understanding of LUA. If there isn't a simple explanation, then maybe someone could give me a link to a video helping? An example could be clicking a button and the door sliding open (not disappearing, the sliding is key to what I'm thinking of). Thanks for any help or advice.

1 answer

Log in to vote
0
Answered by 9 years ago

For a basic sliding door to slide up you need the total height of the door

01height = 6
02parts= script.Parent:GetChildren()
03num = height/.1
04 
05for i = 1,num do
06for i,v in pairs(parts) do
07if v.ClassName == "Part" then
08v.CFrame = CFrame.new(v.CFrame+CFrame.new(0,.1,0)
09end
10end
11wait(.01)
12end
Ad

Answer this question