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

How to make a rising brick?

Asked by 10 years ago
function Changed()
    if game.Workspace.DoorOpen.Value == true then
        script.Parent.Position = Vector3(0, 8.5, 138)
        wait(1)             
    end
end

game.Workspace.Game.Changed:connect(Changed)

How can I make this so the brick keeps on going up, but also gets smaller at the same time? I also have blocks above it, so if it trys to go to 8.5 it cant and just goes above the block. how can I make it so it can go through the block?

3 answers

Log in to vote
2
Answered by
jobro13 980 Moderation Voter
10 years ago

To make bricks go through other bricks you need to use CFrames.

To change the size of the brick, we use the .Size property.

function Changed()
    if game.Workspace.DoorOpen.Value == true then
    while wait() do
        script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0.1,0)
        script.Parent.FormFactor = "Custom" -- to change the size
        if script.Parent.Size.x > 0.2 then 
            script.Parent.Size = script.Parent.Size - Vector3.new(0.1,0.1,0.1)
        end
    end      
    end
end

game.Workspace.Game.Changed:connect(Changed)

0
If I change "Custom" to "Symmetric" and the "0.2" to 1 will that make it change by 1 stud? NinjoOnline 1146 — 10y
0
I added the 0.2 because the smallest brick is (0.2, 0.2, 0.2). If you change Vector3.new(0.1,0.1,0.1) to Vector3.new(1,1,1) then that is what you mean. You can also use Symmetric but Custom is better :) jobro13 980 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago
Vector3.new(0, 8.5, 138)

0
that did nothing, I already have that in the script NinjoOnline 1146 — 10y
Log in to vote
-1
Answered by 10 years ago
vecor3.new(0, 8.5, 138)

Answer this question