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

How to script size so it only grows up in Y direction?

Hi. Noob Here!!!

I made this simple script that makes a part grow in Y direction. the problem is i want it to only grow up in the y direction and not under the baseplate. can someone give me a hint so i can try to figure it out~~~~~~~~~~~~~~~~~

part = game.Workspace.Part

while true do
if part.Size.Y <5 == true then
	part.Size = part.Size + Vector3.new(0,1,0)
	
wait(1)
else
	
end

end


5 comments

0

You could increase the size while also cframing it half the Y increment

0

part.CFrame = part.CFrame * CFrame.new(0,.5,0)

0

This code causes the part to move up instead

0

OK. now i understand what you mean and it works. but I have another script where I can make it smaller when I click it with the mouse. and when I do, it's lifted over the baseplate, so it doesn't work as intended

0

it works. thanks for the answer. just had to do the same with the other script just reversed.

1 answer

You do not need < 5 == true because the if statement will already execute the code if the statement is true without == true, bruh

Also you do not need an if statement in the while loop since the condition is already made


while part.Size.Y < 5 do
       part.Size = part.Size + Vector3.new(0, 1, 0)
end

2 comments

0

This doesn't answer his question.

0

it does not answer the question but I learned something new. but it does not work as intended as the code does not run if the part gets smaller after reaching 5. you could not know there is another script where I can make it smaller by clicking the part with the mouse

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