error:
Scale cannot be assigned to
line it errored on:
Item.Position.X.Scale = 0
and Item is defined the line before it like this:
local Item = Lottery[math.random(1, #Lottery)]:Clone()
and yes lottery is defined
you can't set scale or offset individually.
You need to use UDim2.new() for the property, e.g.
Item.Position = UDim2.new(0, Item.Position.X.Offset, Item.Position.Y.Scale, Item.Position.Y.Offset) -- if you only want to change X scale