Faraon, Posted August 26, 2018 Share Posted August 26, 2018 مرحبا .. كيفكم .. انا سويت لوحة .. بها زرين تفتح بهم الباب مثال button = guiCreateButton(65, 61, 244, 60, "فتح", false, window) button2 = guiCreateButton(65, 148, 244, 60, "اغلاق", false, window) -- DOOR -- door = createObject(980,1893.0999755859,-15.5,36.599998474121,0,0,345) function closedoor() moveObject (door,4000,1893.0999755859,-15.5,36.599998474121) end bindKey(button2,closedoor) -- by the function name function opendoor() moveObject(door,4000,1893.1999511719,-15.300000190735,43.099998474121) end bindKey(button,opendoor) -- by the function name وما يريد يفتح ولا .... ( مو شغال ) الحل ايش؟ Link to comment
#BrosS Posted August 26, 2018 Share Posted August 26, 2018 (edited) "onClientGUIClick" bindKey بدال Edited August 26, 2018 by #BrosS Link to comment
Faraon, Posted August 26, 2018 Author Share Posted August 26, 2018 (edited) addEventHandler("onClientGUIClick",root, function opendoor() if source == button then moveObject(door,4000,1893.1999511719,-15.300000190735,43.099998474121) end ) # function opendoor() addEventHandler("onClientGUIClick",button, moveObject (Door,4000,1893.0999755859,-15.5,36.599998474121) end ) Edited August 26, 2018 by #_Crash+ Link to comment
#BrosS Posted August 26, 2018 Share Posted August 26, 2018 button = guiCreateButton(65, 61, 244, 60, "فتح", false, window) button2 = guiCreateButton(65, 148, 244, 60, "اغلاق", false, window) -------------------------------------------------------- door = createObject(980,1893.0999755859,-15.5,36.599998474121,0,0,345) function brFunc(stat) if stat == "close" then moveObject (door,4000,1893.0999755859,-15.5,36.599998474121) else moveObject(door,4000,1893.1999511719,-15.300000190735,43.099998474121) end end addEventHandler( "onClientGUIClick", getRootElement(), function() if source == button then brFunc("open") elseif source == button2 then brFunc("close") end end ); 1 Link to comment
#_Cras[H]+ Posted August 26, 2018 Share Posted August 26, 2018 4 minutes ago, #BrosS said: button = guiCreateButton(65, 61, 244, 60, "فتح", false, window) button2 = guiCreateButton(65, 148, 244, 60, "اغلاق", false, window) -------------------------------------------------------- door = createObject(980,1893.0999755859,-15.5,36.599998474121,0,0,345) function brFunc(stat) if stat == "close" then moveObject (door,4000,1893.0999755859,-15.5,36.599998474121) else moveObject(door,4000,1893.1999511719,-15.300000190735,43.099998474121) end end addEventHandler( "onClientGUIClick", getRootElement(), function() if source == button then brFunc("open") elseif source == button2 then brFunc("close") 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