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

MathRandom SurfaceGui Size help?

Asked by
Vividex 162
10 years ago

What I have in Studio:

Workspace - Part - HologramGui - Base - Content - Script

The script is:

local con = game.Workspace.Part.HologramGui.Base.Content

while true do
    con.Size = math.random()
end

Its supposed to make the Size of "Content" (Vertically) change its Size randomly. I'm not sure how to make it just make it change the size Vertically and not horizontally. Help please?

1 answer

Log in to vote
0
Answered by 10 years ago

You need to use a UDim2.new value. Try this:

local con = game.Workspace.Part.HologramGui.Base.Content

while true do
    con.Size = UDim2.new(math.random(0,800), 0, 200, 0) -- UDim2 required, not straight change.
    wait(0.5) -- May also want to use a wait to avoid lag/spamming.
end

I'm Aurum, and you're welcome.

Ad

Answer this question