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

How to Resize a Brick using For Loops?

Asked by
yelsew 205 Moderation Voter
8 years ago

I am trying to make a block be resized using a loop, and I can't seem to get it to resize. It just stays the same size no matter what. And if you need to know, the original size is 4, 1, 4. I think I've done this correctly in the past, but now I can't get it to work. Thanks in advance!!! C:

local part = script.Parent
local origpartcframe = part.CFrame
local origpartsize = part.Size
local debounce = false

part.Touched:connect(function()
    if not debounce then
        debounce = true
        for i = 1, 20 do
            part.Size = part.Size - Vector3.new(0.2, 0, 0.2)
            part.CFrame = origpartcframe
            wait(0.1)
        end
        part.Transparency = 1
        part.Anchored = false
        wait(3)
        part.Anchored = true
        part.CFrame = origpartcframe
        part.Size = origpartsize
        for i = 1, 10 do
            part.Transparency = part.Transparency - 0.1
            wait(0.1)
        end
        debounce = false
    end
end)

1 answer

Log in to vote
2
Answered by 8 years ago

Turn the FormFactor of the Part to "Custom"

Since it's symmetrical by default, symmetrical prevents it from being a size with floats.

Ad

Answer this question