MaRcell

[HELP] MY Level System

Recommended Posts

loadstring(exports.dgs:dgsImportFunction())()
local sw, sh = guiGetScreenSize()
local sx, sy = (sw/1920), (sh/1080)

progressbar = dgsCreateProgressBar(80,730, 226, 34,false,nil,nil,tocolor(28 ,28 ,28, 120),nil,tocolor(255,255, 255, 120) , nil)    
text = dgsCreateLabel (0.02,0.04,0.94,0.2,"LEVEL: " ..(getElementData(localPlayer,"Level") or 0),true,progressbar,tocolor(0 ,0 ,0,255), nil, nil,nil,nil,nil,"center")
font = dgsSetFont(text , "bankgothic")
xp = 0

setTimer(function ()
	local team = getPlayerTeam(localPlayer)
	if team then
		dgsSetVisible(progressbar,true)
	else
		dgsSetVisible(progressbar, false)
end
	end,1000,0)

setTimer(function ()
	local xp = getElementData( localPlayer, "xp")
	local level = getElementData(localPlayer, "level")
	if xp and level then
		if xp >=100 then
		setElementData(localPlayer,"level",level +1)
		outputChatBox("#FFFFFF[GANG] #00FFFF Você Passou pro level "..(getElementData(localPlayer,"level").. " na sua gang.",localPlayer,255, 255, 255, true  )
		setElementData(localPlayer,"xp", 0)
		dgsProgressBarSetProgress(progressbar,0)
		else
		setElementData(localPlayer,"xp",xp + 10)
			dgsProgressBarSetProgress(progressbar,xp+10)
		end
		dgsSetText(text,"LEVEL: "..level)
	end

end,60000,0)

 

is giving error in the outputChatBox, in the localPlayer, ta returning q and a value nil do not understand it seems all right ..

Share this post


Link to post
1 hour ago, MaRcell said:

localPlayer

in function outputChatBox, client-side, localPlayer dont use how 2nd argument

Share this post


Link to post

 

how would it be right to use, for the chat to appear just for me? never used outpuchatbox on the client side

Share this post


Link to post
50 minutes ago, MaRcell said:

 

how would it be right to use, for the chat to appear just for me? never used outpuchatbox on the client side

line 25 replace with:

outputChatBox("#FFFFFF[GANG] #00FFFF Você Passou pro level "..(getElementData(localPlayer,"level").. " na sua gang.",255, 255, 255, true  )

Did you know that clientside outputChatBox does always only output the text for yourself, not other people? :) 

  • Like 1

Share this post


Link to post

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.