It means that the first argument of math.random() exceeds the 32-bit integer limit (2,147,483,647). From what I could scavenge from the mess, that would be: (game.Workspace["DAF XF"].Body.XYGlass.Position.X-game.Workspace["DAF XF"].Body.XGlass.Position.X)*100)
I believe you can just follow the post that I found here (with a quick google search):
Wait I’m actually confused what your line of code was trying to achive…What sort of random number? One between 0 and a bigger number? Because you need two numbers for a math.random function, a minimum, and a maximum. The latter must of course be bigger than the former. For example:
local posX = (math.random(0, (game.Workspace["DAF XF"].Body.XYGlass.Position.X-game.Workspace["DAF XF"].Body.XGlass.Position.X)*100)/100)+game.Workspace["DAF XF"].Body.XGlass.Position.X
Make the zero any number as long as you know its less than the number after the comma.
I would suggest formatting it like this
local max = (((game.Workspace["DAF XF"].Body.XYGlass.Position.X-game.Workspace["DAF XF"].Body.XGlass.Position.X)*100)/100)
local addtional = game.Workspace["DAF XF"].Body.XGlass.Position.X
print("max: "..max)
print("additional: "..addtional)
local posX = math.random(0, max + addtional)
local posX
local interval = game.Workspace["DAF XF"].Body.XYGlass.Position.X - game.Workspace["DAF XF"].Body.XGlass.Position.X
if interval ~= 0 then
posX = (math.random(interval * 100) / 100) + game.Workspace["DAF XF"].Body.XGlass.Position.X
else
-- Handle the case when interval is 0
end
This ensures that the math.random function is only called when the interval is non zero.
local max = (((game.Workspace["DAF XF"].Body.XYGlass.Position.X-game.Workspace["DAF XF"].Body.XGlass.Position.X)*100)/100)
local addtional = game.Workspace["DAF XF"].Body.XGlass.Position.X
print("max: "..max)
print("additional: "..addtional)
if max + additional == 0 then additional += 1 end
local posX = math.random(0, math.floor(max + addtional))
Anyways I somehow fixed it, when I fixed an other bug where the raindroplets fell randomly to their death. The problem occured whenever the rainvalue has changed it will fire the second copy of the same script and the first copy will stop.