I want to make a nuke explode and shrink down to normal size again, will this work?
-- This will make the nuke explode and cool down. You can add more to it. nuke = script.Parent pos = nuke.CFrame for i = 5,5,5 do repeat nuke.Size = nuke.Size + Vector3(i) nuke.CFrame = pos until Nuke.Size.X >= 100 if nuke.Size.X>=100 then repeat nuke.Size = nuke.Size - Vector3(i) until nuke.Size.X <=1 end
Your for
loop won't run because i
is initialized at 5 so it doesn't need to do anything to get to 5. for
loops go like so-
for index = start_value, end_value, increment do
By the looks of it you're trying to do something like this-
nuke = script.Parent pos = nuke.CFrame function boom() -- i'd wrap this in a function so you can call it at will :p for i = 5, 25 ,5 do nuke.Size = Vector3.new(i, i, i) nuke.CFrame = pos end for i = 25, 5, -5 do nuke.Size = Vector3.new(i, i, i) nuke.CFrame = pos end end boom()