bartje01 Posted June 12, 2012 Posted June 12, 2012 Hey all. I want that if you reach 5 zombie kills it'll say: achievement unlocked. I have this: if getElementData(attacker, "Zombie Kills") == 5 then outputChatBox ("Achievement unlocked.") Doesn't seem to work. What'wrong?
Castillo Posted June 12, 2012 Posted June 12, 2012 With what event are you running this? Btw, I think it's "Zombie kills" with lower case "kills".
bartje01 Posted June 12, 2012 Author Posted June 12, 2012 Oh indeed ,it was with a lower case. But still, it doesn't work. function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if not zombieKills then setAccountData(account,"Zombie kills",0) end setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) if getElementData(attacker, "Zombie kills") == 5 then outputChatBox ("Achievement unlocked.") end end
Castillo Posted June 12, 2012 Posted June 12, 2012 Your player element is: "killer" but you're using "attacker" there.
X-SHADOW Posted June 12, 2012 Posted June 12, 2012 (edited) function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if not zombieKills then setAccountData(account,"Zombie kills",0) end setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) if getElementData(killer, "Zombie kills") == 5 then outputChatBox ('Achievement unlocked. and you got sepical weapon',killer,255,255,0)--defined the msg sent to who ? giveWeapon ( killer, 31, 200 )--- give him M4 With 200 ammo =D else outputChatBox('Keep on kill to unlocked the Achievement and get your sepical weapon',killer,255,255,0)--speical add =D end end Edited June 12, 2012 by Guest
Castillo Posted June 12, 2012 Posted June 12, 2012 X-SHADOW: I don't want to sound rude, but 'source' is just a name, his player argument is "killer", his only problem is that he's using "attacker" instead of "killer".
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