Dangnoob
Member
- Joined
- Jun 8, 2008
- Messages
- 105
- Solutions
- 2
- Reaction score
- 12
Here is my current script.
As you can see, it gives experience to the player that killed the player. Works and all is well. My question would be now how would I go about dividing that now by all the killers and spread it evenly. For example.
local expForUp = ( getPlayerExperience(target) / 20) / (killers)
And, if its possible, which i dont think it is.. But is there a way to make it "in the same life". If the player attacks a player, dies, and then logs back in, he obviously shouldnt get the experience. Im just not even sure if that is possible through code.
Thanks in advance if anybody can help me.
Nevermind. I got it all figured out.
Code:
function onKill(cid, target, lastHit)
if isPlayer(cid) and isPlayer(target) and getPlayerLevel(cid) < 500 then
local expForUp = getPlayerExperience(target) / 20
doPlayerAddExp(cid, expForUp)
end
return true
end
As you can see, it gives experience to the player that killed the player. Works and all is well. My question would be now how would I go about dividing that now by all the killers and spread it evenly. For example.
local expForUp = ( getPlayerExperience(target) / 20) / (killers)
And, if its possible, which i dont think it is.. But is there a way to make it "in the same life". If the player attacks a player, dies, and then logs back in, he obviously shouldnt get the experience. Im just not even sure if that is possible through code.
Thanks in advance if anybody can help me.
Nevermind. I got it all figured out.
Last edited by a moderator: