button = script.Parent
doors = script.Parent.Parent.CellDoors:GetChildren()
function onClicked()
for i,v in pairs(doors) do
for c = 1, 7, .1 do
v.CFrame = v.CFrame * CFrame.new(c, 0, 0)
wait(0.1)
end
end
end
button.ClickDetector.MouseClick:connect(onClicked)
First, please keep in mind that i'm have very basic scripting knowledge.
With my very limited experience on ROBLOX Lua, after reading this, I'd imagine that once the button is pressed, every children in the model "CellDoors" would slowly slide in a direction, until it had traveled 7 studs.
That's, of course, not what's happening.
When I click the button, the doors, one by one, slide 244 STUDS in one direction - and I am completely baffled as to why this is happening. I must be committing a pretty big mistake, because i don't understand how the number 244 would come into a play, and I don't understand why the doors are sliding one by one instead of all at the same time.
Could anyone shed some light on what it is that I'm failing horribly at doing?

1 comment
You forgot to change one of the CFrame axis's "c".