Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a rising brick?

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

✓ Accepted answer

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)

2 comments

0

If I change "Custom" to "Symmetric" and the "0.2" to 1 will that make it change by 1 stud?

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 :)

Vector3.new(0, 8.5, 138)

1 comment

0

that did nothing, I already have that in the script

This discussion is preserved as it was. New answers, comments, and votes are closed.