Jump to content

How to get money when kill a zombie ?


Recommended Posts

  • 2 weeks later...
Posted
I don't see why you should search for such a easy script, you only need to have basic knowledge of scripting.

You would need to combine the event: "onZombieWasted" with givePlayerMoney.

Im still bigner for scripting i can do simple things like "onPlayerSpawn giveWeapon" and somethings easy

But im very good mapper :D

  • MTA Team
Posted (edited)

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
Posted

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 
) 

Posted

He already got what he was looking for, i don't know why you still posting and try to help him lol

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