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

[SOLVED] How do you add UDim2 values?

Asked by 10 years ago

How do you add UDim2?

For example:

for i = 1,750 do
        wait()
        mf.Size = UDim2.new(0, 0, 0, 35)
    end

--How do I add +1 to the value "35" after every loop?

0
'UDim2.new()' is used for Guis [Just letting you know if your not using for a Gui], to increase the size, just do 'UDim2.new(0,0,0,NUM*35) NUM = NUM + 1' TheeDeathCaster 2368 — 10y

1 answer

Log in to vote
2
Answered by
MrNicNac 855 Moderation Voter
10 years ago
for i = 1,750 do
        wait()
        mf.Size = UDim2.new(0, 0, 0, 35) = UDim2. new(0,0,0,1)
    end

However, I suggest not building a completely new UDim2 and just keeping a single Lua-supported number

local Counter = 35
for i = 1,750 do
        wait()
        mf.Size = UDim2.new(0, 0, 0, Counter)
    Counter = Counter + 1
    end

0
You have a typo. "UDim2.new(0, 0, 0, 35) = UDim2.new(0, 0, 0, 1)" should be "UDim2.new(0, 0, 0, 35) + UDim2.new(0, 0, 0, 1)" Tkdriverx 514 — 10y
Ad

Answer this question