Jump to content

How to get money when kill a zombie ?


Recommended Posts

  • 2 weeks later...

This may work:

  
local ZOMBIE_REWARD = 50 -- The amount of money rewarded to a player once killed 
  
addEventHandler('onZombieWasted', root,  
    function(player) 
        givePlayerMoney(player, ZOMBIE_REWARD) 
    end 
) 
  

Update the first line. I have guessed the syntax of the event.

Edited by Guest
Link to comment

That won't work, you forgot about: addEvent and "root" at second argument of addEventHandler.

local ZOMBIE_REWARD = 50 -- The amount of money rewarded to a player once killed 
  
addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", root, 
    function ( player ) 
        givePlayerMoney ( player, ZOMBIE_REWARD ) 
    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...