Jump to content

Bad Argument


Xeno

Recommended Posts

I get a bad arguement on the getElementData... It should work so im confused... Here is the code.

function checkOnDeath(player, killer) 
if (player and getElementType(player) == "player") then 
    local kills = tonumber(getElementData(player,"Zombie kills")) 
    if (not kills) then setElementData(player, "Zombie kills", 0) kills = 0 end 
    if (kills <= 24) then 
    spawnPlayer ( player, 839, -1375, -0.3, 90.0, 0 ) 
    elseif (kills >= 25 and kills <= 49) then 
    elseif (kills >= 35 and kills <=49) then 
  
    elseif (kills >= 50 and kills <=149) then 
  
    elseif (kills >= 150 and kills <=349) then 
        
 elseif (kills >= 350 and kills <=499) then 
    
      elseif (kills >= 500 and kills <=899) then 
  
      elseif (kills >= 900 ) then 
  
   end 
    end 
end 
  
  
addEventHandler("onPlayerWasted", root, checkOnDeath) 
  
  

Link to comment

My bad, I didn't see the event handler, anyway, you're doing it wrong.

function checkOnDeath(ammo, killer) 
if (killer and getElementType(killer) == "player" and killer ~= source) then 
    local kills = tonumber(getElementData(killer,"Zombie kills")) 
    if (not kills) then setElementData(killer, "Zombie kills", 0) kills = 0 end 
    if (kills <= 24) then 
    spawnPlayer ( killer, 839, -1375, -0.3, 90.0, 0 ) 
    elseif (kills >= 25 and kills <= 49) then 
    elseif (kills >= 35 and kills <=49) then 
  
    elseif (kills >= 50 and kills <=149) then 
  
    elseif (kills >= 150 and kills <=349) then 
        
 elseif (kills >= 350 and kills <=499) then 
    
      elseif (kills >= 500 and kills <=899) then 
  
      elseif (kills >= 900 ) then 
  
   end 
    end 
end 
addEventHandler("onPlayerWasted", root, checkOnDeath) 

Link to comment
My bad, I didn't see the event handler, anyway, you're doing it wrong.
function checkOnDeath(ammo, killer) 
if (killer and getElementType(killer) == "player" and killer ~= source) then 
    local kills = tonumber(getElementData(killer,"Zombie kills")) 
    if (not kills) then setElementData(killer, "Zombie kills", 0) kills = 0 end 
    if (kills <= 24) then 
    spawnPlayer ( killer, 839, -1375, -0.3, 90.0, 0 ) 
    elseif (kills >= 25 and kills <= 49) then 
    elseif (kills >= 35 and kills <=49) then 
  
    elseif (kills >= 50 and kills <=149) then 
  
    elseif (kills >= 150 and kills <=349) then 
        
 elseif (kills >= 350 and kills <=499) then 
    
      elseif (kills >= 500 and kills <=899) then 
  
      elseif (kills >= 900 ) then 
  
   end 
    end 
end 
addEventHandler("onPlayerWasted", root, checkOnDeath) 

Yeah, this doesnt work, I dont get any errors.

Link to comment
Can you explain me what are you trying to do?

I'm trying to make it so it sets a certain spawn area for each team, i did try another script too do it, but I thought this would be easier, I guess not...

function setTeamOnDeath() 
local team = getTeamFromName("Clan1")  
if ( team) then 
spawnPlayer... ect 
end 
addEventHandler("onPlayerWasted", root, setTeamOnDeath) 

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