-- Get objects from orxonox thisscript:addObject("FogEffect", "fog") thisscript:addObject("RainEffect", "rain") thisscript:addObject("SnowEffect", "snow") thisscript:addObject("LightningEffect", "lightning") thisscript:addObject("CloudEffect", "cloud") thisscript:addObject("Hover", "Player") -- Global Variables fogActivated = false rainActivated = false snowActivated = false lightningActivated = false cloudActivated = false function tick(timestep) playerX = Player:getAbsCoorX() playerY = Player:getAbsCoorY() playerZ = Player:getAbsCoorZ() if playerX > -1200 and not cloudActivated then cloud:activate() cloudActivated = true; end if playerX > -1100 and cloudActivated then cloud:cloudColor(1,0,0,5) cloud:skyColor(0,0,0,5) end --if playerX > -1000 and cloudActivated then -- cloud:cloudColor(0.8,0.8,0.8,5) -- cloud:skyColor(0,0,0.8,5) --end --if playerX > -900 and not fogActivated then -- fog:activate() -- fogActivated = true --end --if playerX > -800 and not snowActivated then -- snow:activate() -- snowActivated = true --end --if playerX > -700 and snowActivated then -- snow:deactivate() -- fog:deactivate() --end if playerX > -600 and not rainActivated then rain:startRaining() rainActivated = true end if playerX > -500 and rainActivated and not lightningActivated then lightning:activate() lightningActivated = true end if playerX > -300 and rainActivated and lightningActivated then rain:stopRaining() lightning:deactivate() end return false end