Electro88 Posted February 3, 2016 Author Posted February 3, 2016 function levelup ( ) if isElement ( expLabel ) then destroyElement ( expLabel ) end local Exp = getElementData ( localPlayer, "ExP" ) or 0 local Level = getElementData ( localPlayer, "Level" ) or 0 expLabel = guiCreateLabel ( 0.777, 0.22, 0.1708, 0.0963, "\nToplam Exp: ".. tostring ( Exp ) .."\nLevel: ".. tostring ( Level ), true ) guiLabelSetColor ( expLabel, 0, 255, 0 ) guiLabelSetVerticalAlign ( expLabel, "top" ) guiLabelSetHorizontalAlign ( expLabel, "left", false ) guiSetFont ( expLabel, "clear-normal" ) setTimer ( levelup, 2000, 1 ) end setTimer ( levelup, 2000, 1 ) function onlabelCreate () local ups= guiCreateLabel ( 0.45, 0.48, 0.10, 0.04, "", true) if not guiGetVisible(ups) then guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) guiSetText(ups, "LEVEL ATLADIN ! "..getElementData(localPlayer, "Level")) end end onlabelCreate () addEvent("Zomb_Jump", true)
ViRuZGamiing Posted February 3, 2016 Posted February 3, 2016 You don't do anything with this event it needs a handler what function do you want to trigger? addEvent("Zomb_Jump", true) addEventHandler("Zomb_Jump", getRootElement(), functionNameHere)
Electro88 Posted February 3, 2016 Author Posted February 3, 2016 thanks for trying to, but it doesn't work
Electro88 Posted February 3, 2016 Author Posted February 3, 2016 exports.scoreboard:scoreboardAddColumn ( "Level" ) local levels = { 50, 150, 300, 500, 900, 1000, 1400, 1555, 1850, 2000, 2255, 2400, 2650, 2750, 3000, 4755, 5000, 5500, 5999, 6599, 6850, 7000, 8500, 10000, 10500, 11000, 13500, 15000, 16500, 20000, } addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) addPlayerZombieKills ( killer ) end ) function addPlayerZombieKills ( killer ) local account = getPlayerAccount ( killer ) if isGuestAccount ( account ) then return end local H = tonumber ( getElementData ( killer, "ExP" ) ) or 0 local L = tonumber ( getElementData ( killer, "Level" ) ) or 0 setElementData ( killer, "ExP", tonumber ( H ) + 50 ) local H = ( H + 5 ) local L = ( L + 1 ) if ( L <= #levels ) and ( levels [ L ] ) and ( tonumber ( H ) >= tonumber ( levels [ L ] ) ) then setElementData ( killer, "Level", L ) triggerClientEvent ( killer, "playSound", killer ) end end function onLogin ( _, account ) setElementData ( source, "Level", getAccountData ( account, "lvl" ) or " 0 " ) setElementData ( source, "ExP", getAccountData ( account, "exp" ) or "0" ) end addEventHandler ( "onPlayerLogin", root, onLogin ) function saveData ( thePlayer, theAccount ) if ( theAccount and not isGuestAccount ( theAccount ) ) then setAccountData ( theAccount, "lvl", getElementData ( thePlayer, "Level" ) ) setAccountData ( theAccount, "exp", getElementData ( thePlayer, "ExP" ) ) end end addEventHandler ( "onPlayerQuit", root, function ( ) saveData ( source, getPlayerAccount ( source ) ) end ) addEventHandler ( "onPlayerLogout", root, function ( prev ) saveData ( source, prev ) end )
ViRuZGamiing Posted February 3, 2016 Posted February 3, 2016 There is no trigger to one of those events from the error, is this the full code or the error perhaps from another script? Show the full error code, with line number and .lua file.
Electro88 Posted February 3, 2016 Author Posted February 3, 2016 okay i fixed error but no work level up screen nevermind. thanks for helping all
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