iMr.TZ[W]ER Posted July 10, 2014 Posted July 10, 2014 السلام عليكم ورحمة الله تعالى وبركاته شبااب كنت احاول اسوي مود شيلات المهم سويت ذا الفنكشن function onGuiClick(button, state, absoluteX, absoluteY) if source == GUIEditor.button[1] then local sound = playSound("http://www.shy22.com/code.php?f=load&sb=512&idxmc=908810&d=0.mp3") end end addEventHandler("onClientGUIClick", root, onGuiClick) كذا الزر شغال تمام بس المشكلة اني مب عارف اسكر الفنكشن وانا ابي اسكره علشان اقدر اسوي فنكشن يطفي الصوت ومب عارف ي ليت مساعدة بوقت سريع
iPrestege Posted July 10, 2014 Posted July 10, 2014 addEventHandler ( 'onClientGUIClick',root, function ( ) if ( source == GUIEditor.button[1] ) then sound = playSound ( 'http://www.shy22.com/code.php?f=load&sb=512&idxmc=908810&d=0.mp3' ) elseif ( source == StopSoundButton ) then if isElement ( sound ) then destroyElement ( sound ) end end end ) استبدل زر الايقاف بـ ( StopSoundButton )
iMr.TZ[W]ER Posted July 10, 2014 Author Posted July 10, 2014 addEventHandler ( 'onClientGUIClick',root, function ( ) if ( source == GUIEditor.button[1] ) then sound = playSound ( 'http://www.shy22.com/code.php?f=load&sb=512&idxmc=908810&d=0.mp3' ) elseif ( source == StopSoundButton ) then if isElement ( sound ) then destroyElement ( sound ) end end end ) استبدل زر الايقاف بـ ( StopSoundButton ) مشكوووووور شغال تمام تمام بس ممكن اعرف شلون لو كان ساوند شغال ما اقدر اشغله بعد مرة ولو من زر ثاني ومشكور بعد مرة
xX|KeMo|Xx Posted July 10, 2014 Posted July 10, 2014 addEventHandler ( 'onClientGUIClick' ,root, function ( ) if ( source == GUIEditor.button [ 1] ) then if not isElement ( sound ) then sound = playSound ( 'http://www.shy22.com/code.php?f=load&sb=512&idxmc=908810&d=0.mp3' ) end elseif ( source == StopSoundButton ) then if isElement ( sound ) then destroyElement ( sound ) end end end )
Max+ Posted July 10, 2014 Posted July 10, 2014 addEventHandler ( 'onClientGUIClick' ,root, function ( ) if ( source == GUIEditor.button [ 1] ) then if not isElement ( sound ) then sound = playSound ( 'http://www.shy22.com/code.php?f=load&sb=512&idxmc=908810&d=0.mp3' ) end elseif ( source == StopSoundButton ) then if isElement ( sound ) then destroyElement ( sound ) end end end ) if not isElement ( sound ) then ليش تتحقق اذا لم يكون الالمنت صوت وبعدين تتحقق اذا الالمنت صوت وتحذف الصوت ؟
TAPL Posted July 10, 2014 Posted July 10, 2014 addEventHandler ( 'onClientGUIClick' ,root, function ( ) if ( source == GUIEditor.button [ 1] ) then if not isElement ( sound ) then sound = playSound ( 'http://www.shy22.com/code.php?f=load&sb=512&idxmc=908810&d=0.mp3' ) end elseif ( source == StopSoundButton ) then if isElement ( sound ) then destroyElement ( sound ) end end end ) if not isElement ( sound ) then ليش تتحقق اذا لم يكون الالمنت صوت وبعدين تتحقق اذا الالمنت صوت وتحذف الصوت ؟ التحقق الأول عشان يشغل الصوت و ما يشغله مره ثانية يعني ما يشتغل بتكرار التحقق الثاني ذا حق زر الأيقاف عشان يحذف الصوت إذا كان موجود ولاحظ ان التحقق في زرين مختلفين
#DRAGON!FIRE Posted July 10, 2014 Posted July 10, 2014 addEventHandler ( 'onClientGUIClick' ,root, function ( ) if ( source == GUIEditor.button [ 1] ) then if not isElement ( sound ) then sound = playSound ( 'http://www.shy22.com/code.php?f=load&sb=512&idxmc=908810&d=0.mp3' ) end elseif ( source == StopSoundButton ) then if isElement ( sound ) then destroyElement ( sound ) end end end ) if not isElement ( sound ) then ليش تتحقق اذا لم يكون الالمنت صوت وبعدين تتحقق اذا الالمنت صوت وتحذف الصوت ؟ التحقق يتحقق لو الالمنت موجود او لأ ..
Max+ Posted July 10, 2014 Posted July 10, 2014 if not isElement ( sound ) then يعني ذي تستخدم اذا الصوت غير شغال ؟ والثانية اذا الصوت شغال يغلقه . Ok , Rogger That ,
#DRAGON!FIRE Posted July 10, 2014 Posted July 10, 2014 if not isElement ( sound ) then يعني ذي تستخدم اذا الصوت غير شغال ؟ والثانية اذا الصوت شغال يغلقه . Ok , Rogger That , if ( isElement( sound ) ) then return true end if not ( isElement( sound ) ) then return false end
iMr.TZ[W]ER Posted July 11, 2014 Author Posted July 11, 2014 الله يعطيكم الف الف عافية يا شباب ومشكور جدا يا كيمو الله يرضى عليك
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