Hi again, i've never really scripted before so i'm not sure what i am doing wrong. The following piece of code appears to work and does what i want it to in game, but causes eufloria to crash after what appears to be random lengths of time. Sometimes the game will last 30 seconds, sometimes 10 minutes. Could someone have a look and let me know what's wrong? thanks.
--Determines Send Distance
for i=1,4 do
Roid = GetAsteroid((i-1))
nSlots = Roid:FreeSlots()
nTrees = Roid:GetNumTrees()
tTrees = nTrees + nSlots
Roid.SendDistance = (nTrees/tTrees)*(1500 + (1500 *(math.cos(math.rad(Timer)))))
end