R3ter Posted June 5, 2016 Share Posted June 5, 2016 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
Walid Posted June 5, 2016 Share Posted June 5, 2016 addEventHandler("onClientPlayerWasted",localPlayer,killl) Link to comment
R3ter Posted June 5, 2016 Author Share Posted June 5, 2016 addEventHandler("onClientPlayerWasted",localPlayer,killl) thanks but it show to the player who died how can i make it shows to the killer ?? Link to comment
ViRuZGamiing Posted June 5, 2016 Share Posted June 5, 2016 kills = 0 function killl(killer) kills = kills + 1 outputChatBox("kills="..kills, killer) -- 2nd argument (visibleTo) end addEventHandler("onClientPlayerWasted",getRootElement(), killl) Link to comment
WhoAmI Posted June 5, 2016 Share Posted June 5, 2016 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
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