Jump to content

setSkyGradient Function not work


Recommended Posts

Hey,

I try to make a script which can change the sky colour.

That's my code:

function changeSkyColor ( commandName, topred, topgreen, topblue, bottomred,bottomgreen,bottomblue )
   topRed = tonumber ( topRed )
   topGreen = tonumber ( topGreen )
   topBlue = tonumber ( topBlue )
bottomRed = tonumber ( bottomRed )
bottomGreen = tonumber ( bottomGreen )
bottomBlue = tonumber ( bottomBlue )
   if topRed and topGreen and topBlue and bottomRed and bottomGreen and bottomBlue then
       setSkyGradient( topRed, topGreen, topBlue, bottomRed, bottomGreen, bottomBlue )
   else
      outputChatBox ( "Failed to change the sky colour!" )
   end
end
 
addCommandHandler ( "setsky", changeSkyColor )

But it is not working :(

Can someone help me?

Greetings

Link to comment

variables are case sensitive. it must be "topRed" not "topred" etc:

function changeSkyColor ( commandName, topRed, topGreen, topBlue, bottomRed,bottomGreen,bottomBlue ) --capital letters here
   topRed = tonumber ( topRed )
   topGreen = tonumber ( topGreen )
   topBlue = tonumber ( topBlue )
  bottomRed = tonumber ( bottomRed )
  bottomGreen = tonumber ( bottomGreen )
  bottomBlue = tonumber ( bottomBlue )
if topRed and topGreen and topBlue and bottomRed and bottomGreen and bottomBlue then
setSkyGradient( topRed, topGreen, topBlue, bottomRed, bottomGreen, bottomBlue )
else
outputChatBox ( "Failed to change the sky colour!" )
end
end
 
addCommandHandler ( "setsky", changeSkyColor )

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...