youpit Posted March 10, 2010 Posted March 10, 2010 Hello Y have problem with my water script color ( the pink colors ) addEventHandler('onClientResourceStart', resourceRoot, function() setWaterColor ( 0, 185, 255, 255 ) end )
Dark Dragon Posted March 10, 2010 Posted March 10, 2010 resourceRoot is unexisting, you don't define it anywhere, you can do one of the following: local resourceRoot = getResourceRootElement(getThisResource()) addEventHandler('onClientResourceStart', resourceRoot, function() setWaterColor ( 0, 185, 255, 255 ) end ) or addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()), function() setWaterColor ( 0, 185, 255, 255 ) end )
Dark Dragon Posted March 10, 2010 Posted March 10, 2010 it is indeed blue, that's the color you have chosen D: its R G B A (red green blue alpha), keep that in mind
youpit Posted March 10, 2010 Author Posted March 10, 2010 Sorry y am beginner of scripting Whats code for pink?
Dark Dragon Posted March 10, 2010 Posted March 10, 2010 setWaterColor(255,56,192,192) should result in a fine pink. if you want a different one you can just get the values from most painting programs, which usually come with a color picker you can use for convenience
youpit Posted March 10, 2010 Author Posted March 10, 2010 ..... the color D'ont change The exact codes is? local resourceRoot = getResourceRootElement(getThisResource()) addEventHandler('onClientResourceStart', resourceRoot, function() setWaterColor(255,56,192,192) end ) Meta <meta> <info author="." description="."/> <script src="script.lua"/> </meta>
Dark Dragon Posted March 10, 2010 Posted March 10, 2010 your meta.xml is the problem. setWaterColor is a client-side function, but your meta.xml tries to load your script server-side (default type is "server") <meta> <info author="." description="."/> <script src="script.lua" type="client"/> </meta>
robhol Posted March 11, 2010 Posted March 11, 2010 resourceRoot is unexisting, you don't define it anywhere, you can do one of the following: local resourceRoot = getResourceRootElement(getThisResource()) addEventHandler('onClientResourceStart', resourceRoot, function() setWaterColor ( 0, 185, 255, 255 ) end ) or addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()), function() setWaterColor ( 0, 185, 255, 255 ) end ) Redundant. getResourceRootElement() will work just fine by itself.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now