Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

MathRandom SurfaceGui Size help?

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.