Jump to content

onClientGuiClick - Taples , مساعدة بـ


Recommended Posts

سلام عليكم

ممكن تصحيح لهذا الكود

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

طريقتك ماتنفع 

المهم جرب

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

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