PleaseScript Posted September 26, 2012 Share Posted September 26, 2012 When the player kills the other in the following script The Following Error ERROR: [gameplay]\scores\scores.lua : 10 attem to perform arithmetic on a boolean value exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function win(ammo, killer, weapon, bodypart) local H = getElementData(killer, "EXP") local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) if killer and killer ~=source then setElementData(killer, "EXP", tonumber(H)+1) if tonumber(H) == 10 then setElementData(killer, "Level", "Lvl 1") elseif tonumber(H) == 20 then setElementData(killer, "Level", "Lvl 2") elseif tonumber(H) == 30 then setElementData(killer, "Level", "Lvl 3") elseif tonumber(H) == 40 then setElementData(killer, "Level", "Lvl 4") elseif tonumber(H) == 50 then setElementData(killer, "Level", "Lvl 5") elseif tonumber(H) == 60 then setElementData(killer, "Level", "Lvl 6") end outputChatBox(killer1 .. "Killed " .. noob .. " and gained +1 EXP", getRootElement(), 255, 255, 0, false) end end addEventHandler( "onPlayerWasted", getRootElement(), win) Link to comment
TAPL Posted September 26, 2012 Share Posted September 26, 2012 lol, i saw this code almost 5 - 6 times in Scripting section. Change this local H = getElementData(killer, "EXP") to local H = getElementData(killer, "EXP") or 0 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