Jump to content

Is this okay?


Javier

Recommended Posts

Hello friends, look my script. I want the water to change color but do not know if this is well done.

local waters = { } 
     water[1] = "255, 255, 100, 20" 
     water[2] = "100, 20, 30, 40" 
     water[3] = "0, 0, 0, 0" 
      
function cambio () 
     setWaterColor ( [ math.random ( #waters ) ] ) 
end 
addEventHandler("onResourceStart", cabio) 
  
setTimer(cambio, 10000, 0)    
  

Thanks.

Link to comment
local waters = { 
     { 255, 255, 100, 20 }, 
     { 100, 20, 30, 40 }, 
     { 0, 0, 0, 0 } 
} 
      
function cambio ( ) 
     setWaterColor ( unpack ( waters [ math.random ( #waters ) ] ) ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, cambio ) 
  
setTimer ( cambio, 10000, 0 ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...