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

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

Asked by 4 years ago

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

~~~~~~~~~~~~~~~~~

0
You could increase the size while also cframing it half the Y increment xEmmalyx 285 — 4y
0
part.CFrame = part.CFrame * CFrame.new(0,.5,0) xEmmalyx 285 — 4y
0
This code causes the part to move up instead Kaptajnfar 15 — 4y
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 Kaptajnfar 15 — 4y
0
it works. thanks for the answer. just had to do the same with the other script just reversed. Kaptajnfar 15 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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
0
This doesn't answer his question. ScuffedAI 435 — 4y
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 Kaptajnfar 15 — 4y
Ad

Answer this question