Hey! So Im making a coin effect and I want coins to appear at random positions on the screen.
if CoinAmount < 17 then
wait(5)
for i =1, CoinAmount do
local coinImg = script.Parent.CoinImg:Clone()
coinImg.Parent = script.Parent
coinImg.Name = tostring(i)
local yPos = math.random(0.200,0.700)
local xPos =math.random(0.200,0.700)
coinImg.Position = UDim2.new(xPos,0,yPos,0)
print("X POS: " ..xPos)
print(i)
wait(math.random(0.37,0.77))
end
end
This is the code I have but the “math.Random” Isnt working. It just keeps showing up as zero. What should I do?