brocky Posted October 24, 2015 Share Posted October 24, 2015 The problem with this script is that when you click the button called "ButtonExtract" then a progress bar will appear and start progressing till the width is reached to 532 and the problem is that, When you click the button, the progress bar fills half and then again you will have to click to complete the progress bar, All I want is that the progress Bar should start when you click the buton and ends smoothly. function loading() if buttonExtract == source then local now = getTickCount() with = interpolateBetween(0,0,0,532,0,0, (now - start) / (( start + 10000 ) - start ) , "Linear" ) dxDrawRectangle(142, 222, with, 41, tocolor(23, 23, 231, 255), false) if with < 532 then triggerServerEvent("payMoney", localPlayer) else removeEventHandler("onClientRender", getRootElement(), loading) end end end addEventHandler("onClientRender", getRootElement(), loading) addEventHandler("onClientGUIClick", buttonExtract, loading, false) Link to comment
Aristates Posted October 24, 2015 Share Posted October 24, 2015 Okay Just it write code. I have not tested function loading() if buttonExtract == source then local now = getTickCount() with = interpolateBetween(0,0,0,532,0,0, (now - start) / (( start + 10000 ) - start ) , "Linear" ) dxDrawRectangle(142, 222, with, 41, tocolor(23, 23, 231, 255), false) if with < 532 then triggerServerEvent("payMoney", localPlayer) else removeEventHandler("onClientRender", getRootElement(), loading) end end end addEventHandler("onClientRender", getRootElement(), loading) addEventHandler("onClientClick", root, function(button, state, x, y) if button == "left" and state == "down" then if x >= 142 and y >= 222 then -- Write You'r Code end 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