Jump to content

help


R3ter

Recommended Posts

kills=0 
  
function killl( killer ) 
  
  
kills=kills+1 
  
outputChatBox("kills="..kills) 
  
end 
  
addEventHandler("onClientPlayerWasted",getRootElement(),killl) 

can anyone tell me why is that is "kills=" shows for everyone ??

(it's on client-side)

Link to comment

If you want to collect how many kills did player get you have to make it s-side and store it in table.

local kills = {} 
  
addEventHandler("onPlayerWasted", root, function(_, killer) 
    if isElement(killer) and getElementType(killer) == "player" then 
        local killInt = kills[killer] 
        if not killInt then 
            killInt = 0 
        end 
         
        kills[killer] = killInt + 1 
    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...