Jump to content

تصحيح كود


Recommended Posts

Posted

سلام عليكم

ابي اسوي لما المود يشتغل الاغنية تشتغل

ولما اضغط زر معين الاغنية تقفل

لكن المشكلة هنا لما اضغط الزر الصوت يتكرر اكثر من مرة ما يقفل

محاولتي:

addEventHandler("onClientResourceStart",root)
addEventHandler( 'onClientGUIClick', root,
function()
	local sound2 = playSound("music.mp3") --Play wasted.mp3 from the sounds folder
	setSoundVolume(sound2, 0.5) -- set the sound volume to 50%
	if (source == Go) then
	    stopSound( sound2 )
end
end
)

 

Posted
8 minutes ago, Mr.Mostafa said:

سلام عليكم

ابي اسوي لما المود يشتغل الاغنية تشتغل

ولما اضغط زر معين الاغنية تقفل

لكن المشكلة هنا لما اضغط الزر الصوت يتكرر اكثر من مرة ما يقفل

محاولتي:


addEventHandler("onClientResourceStart",root)
addEventHandler( 'onClientGUIClick', root,
function()
	local sound2 = playSound("music.mp3") --Play wasted.mp3 from the sounds folder
	setSoundVolume(sound2, 0.5) -- set the sound volume to 50%
	if (source == Go) then
	    stopSound( sound2 )
end
end
)

 

addEventHandler("onClientResourceStart",root,
function()
	sound2 = playSound("music.mp3") --Play wasted.mp3 from the sounds folder
	setSoundVolume(sound2, 0.5) -- set the sound volume to 50%
end
)

addEventHandler( 'onClientGUIClick', root,
	function()
    	if (source == Go) then
	    stopSound( sound2 )
     	end
   end
)

كوداتك تخبييص

Posted
1 minute ago, +Source|> said:

addEventHandler("onClientResourceStart",root,
function()
	sound2 = playSound("music.mp3") --Play wasted.mp3 from the sounds folder
	setSoundVolume(sound2, 0.5) -- set the sound volume to 50%
end
)

addEventHandler( 'onClientGUIClick', root,
	function()
    	if (source == Go) then
	    stopSound( sound2 )
     	end
   end
)

كوداتك تخبييص

طيب كنت بسوي دي اصلا

بس sound2 

مب معرفة بالفنكشن التاني !!

Posted
6 hours ago, Mr.Mostafa said:

طيب كنت بسوي دي اصلا

بس sound2 

مب معرفة بالفنكشن التاني !!

كذا اشتغلت معك ؟

Posted
sound = playSound("music.mp3")
setSoundVolume(sound, 0.5)


addEventHandler( 'onClientGUIClick', root,
function()
if ( source == Go ) then
stopSound( sound )
end
end
)

غير مجرب

Posted

اب

9 hours ago, #MR.NaiF said:

sound = playSound("music.mp3")
setSoundVolume(sound, 0.5)


addEventHandler( 'onClientGUIClick', root,
function()
if ( source == Go ) then
stopSound( sound )
end
end
)

غير مجرب

اشتغل كفو تسلم

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