When the player clicks on a button the gate moves up a few meters off of the ground. When the player clicks the button again the gate moves back into it's starting position.
I am trying to do this with a model of a castle gate which means there is few bricks in the model.
Use the :TranslateBy(); method, for example:
local model = game.Workspace["MODELNAME"]; -- The model you want to move up local part = model["MAINPART"]; -- The main part of the model (will be used as the center) local increment = 1 --The amount you want it to go up by each time local max = 10 --The studs you want to go up by local closed = true; function onClick() if closed then move = increment else move = -increment end for i=1, max/increment do model:TranslateBy(Vector3.new(0,move,0)); end end Button.MouseClick:connect(onClick());
This shifts the model upwards/downward depending on the closed boolean.