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 8 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 8 years ago

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

height = 6
parts= script.Parent:GetChildren()
num = height/.1

for i = 1,num do
for i,v in pairs(parts) do
if v.ClassName == "Part" then
v.CFrame = CFrame.new(v.CFrame+CFrame.new(0,.1,0)
end
end
wait(.01)
end
Ad

Answer this question