Jump to content

[help]


Ahmed Ly

Recommended Posts

hello guys
I want music moving with the Progress bar and ended up being the Progress has become 100
 code

--- Client

addEventHandler ( "onClientGUIClick",root,
function ()
if source == button1 then 
link = guiGetText(editBox) 
triggerServerEvent("start",localPlayer,link)
end 
end
)
soundPosition = 0
function timer ()
	soundPosition = soundPosition + 1 
	guiProgressBarSetProgress(progressbar,soundPosition)
	if soundPosition == 100 then
		soundPosition = 0
	end 
end

addEvent("p",true)
addEventHandler("p",root,
function (link)
if isElement(sound1) then stopSound(sound1) end  
sound1 = playSound(""..link.."",false)
setTimer(timer,3000,1)
end
)
-- Server
addEvent("start",true)
addEventHandler("start",root,
function (link)
triggerClientEvent(root,"p",root,link)
end
)

 

Link to comment
  • Moderators

You can get length of the sound with the functions I also posted.

For the timer update use your own imagination. I would personally go for onClientRender, because it is smoother. But a fast timer could do the job too.

 

 

  • Thanks 1
Link to comment
31 minutes ago, IIYAMA said:

You can get length of the sound with the functions I also posted.

For the timer update use your own imagination. I would personally go for onClientRender, because it is smoother. But a fast timer could do the job too.

 

 

thank you so much
 

Link to comment
1 hour ago, IIYAMA said:

You can get length of the sound with the functions I also posted.

For the timer update use your own imagination. I would personally go for onClientRender, because it is smoother. But a fast timer could do the job too.

 

 

now i have new question how check if the player put link or not in edit Box
i Use function string.find or no ??

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