Mr.Mostafa Posted November 9, 2018 Share Posted November 9, 2018 سلام عليكم ممكن تصحيح لهذا الكود local buttons = { ['GUIEditor.button[1]'] = {message = 'this is button 1'}, ['GUIEditor.button[2]'] = {message = 'this is button 2'}, } addEventHandler("onClientGUIClick", root, function () if buttons[source] then outputChatBox(buttons[source].message,255,0,0,true) end end ) Link to comment
#\_oskar_/# Posted November 15, 2018 Share Posted November 15, 2018 طريقتك ماتنفع المهم جرب local buttons = { -- {button = element button , message = string message [,r,g,b]}, {button = GUIEditor.button[1] , message = 'this is button 1'}, {button = GUIEditor.button[2] , message = 'this is button 2'}, } addEventHandler ( "onClientGUIClick",root,function () for i, v in ipairs (buttons) do if source == v.button then outputChatBox(v.message,v[1] or 255,v[2] or 0,v[3] or 0,true) end end end) Link to comment
TAPL Posted November 16, 2018 Share Posted November 16, 2018 local buttons = { [GUIEditor.button[1]] = {message = 'this is button 1'}, [GUIEditor.button[2]] = {message = 'this is button 2'}, } addEventHandler("onClientGUIClick", guiRoot, function () if buttons[source] then outputChatBox(buttons[source].message,255,0,0,true) end end ) Link to comment
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