GamerDeMTA Posted July 11, 2013 Share Posted July 11, 2013 Hey, I need help. I want to do this when I killed 100 Zombies. How to do it Only when I killl 100 Zombies? outputChatBox("You Killed 100zombies!!!", getLocalPlayer ( ), 255, 255, 255, true) Link to comment
Adde Posted July 11, 2013 Share Posted July 11, 2013 (edited) I used to have a script almost same as this you want. I don´t remember it very good but if you have the zombiekills_scoreboard resource you can do something like this: function 100kills(_, account) local kills = getAccountData ( account, "Zombiekills" ) if ( player == source ) then if ( kills == 100 ) then outputChatBox ( "You have killed 100zombies!!!", getLocalPlayer(), 255, 255, 255 ) end end If someone else see any errors or something missing please correct it. Edited July 11, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted July 11, 2013 Share Posted July 11, 2013 and who is the player in if ( player == source ) then Link to comment
GamerDeMTA Posted July 11, 2013 Author Share Posted July 11, 2013 Oh thanks but I haven't zombies_scoreboard in "zombies", I downloaded it from the Community and there wasn't that script. How to get it? Link to comment
Adde Posted July 11, 2013 Share Posted July 11, 2013 (edited) and who is the player in if ( player == source ) then I said that if something is missing or wrong please correct, I don´t remember the script I used long time ago so much. And I think that GamerDeMTA want to get an answear, haha. GamerDeMTA, you download zombiekills_scoreboard from community. Then you have to create a script by yourself with almost that code I wrote. Edited July 11, 2013 by Guest Link to comment
GamerDeMTA Posted July 11, 2013 Author Share Posted July 11, 2013 u know where to download zombies_scoreboard or can u send me? Link to comment
فاّرس Posted July 11, 2013 Share Posted July 11, 2013 https://community.multitheftauto.com/in ... ls&id=3715 Link to comment
iMr.3a[Z]eF Posted July 11, 2013 Share Posted July 11, 2013 addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local zombiekills = getAccountData(account,"Zombie kills") or 0 if (zombiekills == 100) then outputChatBox ( "You have killed 100zombies!!!", source, 255, 255, 255 ) end end ) Link to comment
denny199 Posted July 11, 2013 Share Posted July 11, 2013 addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local zombiekills = getAccountData(account,"Zombie kills") or 0 if (zombiekills == 100) then outputChatBox ( "You have killed 100zombies!!!", source, 255, 255, 255 ) end end ) That will not work... onZombieWastedThis triggers when a zombie is killed. Parameters element attacker, float weapon, float bodypart attacker: The Element that killed the zombie weapon: The weapon id used to kill the zombie bodypart: The bodypart id that was hit to kill the zombie Source The source of this event is the zombie that died And now you need a costum save system for the kills. Also: https://wiki.multitheftauto.com/wiki/Slothman/Zombies Chek it out for more usefull functions Link to comment
MTA Team 0xCiBeR Posted July 12, 2013 MTA Team Share Posted July 12, 2013 Without custom kill save: addEventHandler("onPlayerSpawn",root, function() local zombiekills = getElementData(source,"Zombie kills") if (zombiekills == 100) then outputChatBox ( "You have killed 100zombies!!!", source, 255, 255, 255 ) else outputChatBox ( "#00ffffYou have killed:#ff0000 " ..tonumber(zombiekills), source, 255, 255, 255,true ) 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