Jump to content

Color picker problem


TheIceman1

Recommended Posts

addEventHandler("onClientGUIClick", GUIEditor_Button[1],  
 function()  
 exports.cpicker:openPicker(localPlayer, "#FFAA00", "Clan system") 
 end) 
  
addEvent ( "onColorPickerOK", true ) 
addEventHandler("onColorPickerOK", root,  
 function(element, hex, r, g, b) 
 guiSetText(GUIEditor_Edit[2], r ) 
 guiSetText(GUIEditor_Edit[3], g ) 
 guiSetText(GUIEditor_Edit[4], b ) 
 end) 
  

Edited by Guest
Link to comment
If you don't use the following arguments:

elements, hex; why are you passing them to this function?

if i delete "element" and "hex" then in edit says "#f0f00"(hex code).

addEventHandler("onClientGUIClick", GUIEditor_Button[1],  
 function()  
 exports.cpicker:openPicker(localPlayer, "#FFAA00", "Clan system") 
 end) 
  
addEvent ( "onColorPickerOK", true ) 
addEventHandler("onColorPickerOK", root,  
 function(element, hex, r, g, b) 
 guiSetText(GUIEditor_Edit[2], r ) 
 guiSetText(GUIEditor_Edit[3], g ) 
 guiSetText(GUIEditor_Edit[4], b ) 
 end) 
  

Link to comment
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], 
    function ( ) 
        exports.cpicker:openPicker ( localPlayer, "#FFAA00", "Clan system" ) 
    end 
    ,false 
) 
  
addEvent ( "onColorPickerOK", true ) 
addEventHandler ( "onColorPickerOK", root, 
    function ( element, hex, r, g, b ) 
        guiSetText ( GUIEditor_Edit[2], r ) 
        guiSetText ( GUIEditor_Edit[3], g ) 
        guiSetText ( GUIEditor_Edit[4], b ) 
        outputChatBox ( r ..", ".. g ..", ".. b ) 
    end 
) 

See what it outputs to chat.

Link to comment

There was two edits with name GUIEditor_Edit[4],but i have new problem

Why this dont set element data?Error "setElementData"[Expected bool at argument 4, got string"59"]

local r = guiGetText ( GUIEditor_Edit[2]  ) 
local g = guiGetText ( GUIEditor_Edit[3]  ) 
local b = guiGetText ( GUIEditor_Edit[4]  ) 
  
setElementData ( localPlayer, "color", r, g, b ) 

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