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

Vector3 not working for "for" loop when increases in size?

[Sorry for bad title had to be more specific] Okay so Im trying to make a part extend on every side here is the script

pt = game.Workspace.CHIP

for ok = 1,12 do
pt.Size = Vector3.new(1,1,1)+Vector3.new(1,1,1)
end

Okay so basically it's not extending how I want it I want it every 12 times to extend +1,1,1 But it just goes to Size 2,2,2 and it does it instantly ANy Idea why?

1 answer

✓ Accepted answer

If you want the part to increase in size, you need to add the Vector3.new(1, 1, 1) to the part's existing size, like this:

pt = game.Workspace.CHIP

for ok = 1,12 do
	pt.Size = pt.Size + Vector3.new(1, 1, 1)
end

Additionally, if you want it to gradually increase in size, you can use wait(), like this:

pt = game.Workspace.CHIP

for ok = 1,12 do
	pt.Size = pt.Size + Vector3.new(1, 1, 1)
	wait(0.5)
end

Hopefully this helps.

1 comment

0

Hey it did thanks !!!

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