#Why is the ImageLabel resizing to 0?

1 messages · Page 1 of 1 (latest)

gloomy plume
#

I have this part of code, but after resizing the ImageLabel to a new size.Line 4 prints {(0,0),(0,0)}

task.wait(0.001,0.05)
                            local Tri = CGui.Triangle:Clone()    
                            Tri.Size = UDim2.new({math.random(0.1,0.2),0},{math.random(0.1,0.2),0})
                            print(Tri.Size,Tri) --Prints 0
                            Tri.Parent = CGui
                            Tri.Visible = true
                            Tri.Rotation = math.random(-360,360)    
                            local DTime = math.random(1,2.5)
                            game.Debris:AddItem(Tri,DTime)
steep cobalt
#

cus i dont think math.random can give decimals

#

u could do math.random(1,2)/10

#

or math.random(10,20)/100

#

whatever u want

gloomy plume
#

Thanks

#

I’ll try that.

somber moat
#

I'd recommend using Random.new() instead

local rand = Random.new()


task.wait()
local Tri = CGui.Triangle:Clone()    
Tri.Size = UDim2.fromScale(rand:NextNumber(0.1, 0.2), rand:NextNumber(0.1, 0.2))
print(Tri.Size,Tri) --Prints 0
Tri.Parent = CGui
Tri.Visible = true
Tri.Rotation = rand:NextNumber(-360,360)    
local DTime = rand:NextNumber(1,2.5)
game.Debris:AddItem(Tri,DTime)