How to make a ui object such as textlabel appear anywhere on screen
Like in simulators
How to make a ui object such as textlabel appear anywhere on screen
Like in simulators
Put this local script inside of the label:
local label = script.Parent
label.Position = UDim2.fromScale(math.random(0,50), math.random(0,50))
You can change label.Position to Udim2.new(your position)
I would recommend using scale instead.
local label = script.Parent
label.Position = UDim2.new(math.random(0, 100)/100-label.Size.X.Offset, label.Size.X.Offset, 0, 0)
--Replace Y with anything u want
what would happen if i increased 50 to 100 or something
Don’t do the above methods, they use math.random
with an argument!
--When the label spawns:
label.Position = UDim2.fromScale(math.random(), math.random())
--This will place it randomly anywhere on the screen.
If you want it to only cover the bottom half of the screen:
--When the label spawns:
label.Position = UDim2.fromScale(math.random(), (math.random()/2)+0.5)
--This will place it randomly anywhere on the bottom half of the screen.