Jump to content

progress bar doesnt change


kewizzle

Recommended Posts

my progress bar doesnt change to my weapon stat stays frozen at the first number it was set to.

client

			local stat8 = getPlayerStat (getLocalPlayer(),77)

addEventHandler("onClientGUIClick", ak47B, function()
if source == ak47B then
		triggerServerEvent ("setAK471",getLocalPlayer(),setAK471)
		guiProgressBarSetProgress(ak47Pr,tonumber(stat8/10))
	end
end)
end)

server

addEvent("setAK471",true) 
addEventHandler("setAK471",root, function()
												if getPlayerStat(source,77) == 0 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
													takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 100)
												else if getPlayerStat(source,77) == 100 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
													takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 200)
												else if getPlayerStat(source,77) == 200 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 300)
												else if getPlayerStat(source,77) == 300 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 400)
												else if getPlayerStat(source,77) == 400 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 500)
												else if getPlayerStat(source,77) == 500 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 600)
												else if getPlayerStat(source,77) == 600 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 700)
												else if getPlayerStat(source,77) == 700 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 800)
												else if getPlayerStat(source,77) == 800 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 900)
												else if getPlayerStat(source,77) == 900 and getPlayerMoney(source) >= getPlayerStat(source,77) + 2500 then
												takePlayerMoney(source, getPlayerStat(source,77) + 2500)
													setPlayerStat(source, 77, 1000)
												else if getPlayerStat(source,77) == 1000 then
												outputChatBox("You maxed out your AK-47!",source,0,255,0)
												else
												local pMoney = getPlayerStat(source,77)
												local convertedMoney = convertNumber(pMoney + 2500)
												outputChatBox("$"..convertedMoney.." required to purchase this skill!",source,255,0,0)
											end
										end
									end
								end
							end
						end
					end
				end
			end
		end
	end
end)

 

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