• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Kill Death Script question

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,200
Solutions
2
Reaction score
149
Hello, this script works: If one player kill one player 200+ he takes an storage...
I need to if who death are lvl 200- dont take the storage...

Script:
Code:
function onKill(creature, target)
    if target:isPlayer() and target:getLevel() > 200 then
        creature:setStorageValue(167912, math.max(0, creature:getStorageValue(167912)) + 1)
        
         db.query("UPDATE `players` SET `frag_points` = `frag_points` + '1' WHERE `name` = '"..creature:getName().."';")
    end
    return true
end
 
function onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    if lasthitkiller and lasthitkiller:isPlayer() then
        creature:setStorageValue(167913, math.max(0, creature:getStorageValue(167913)) + 1)
    end
    return true
end


I try this (wrong):
if lasthitkiller and lasthitkiller:isPlayer() and lasthitkiller:getLevel() > 200 then



Help :D
 
target:getLevel() >= 200 then

edit: I don't get what you want to achieve, please explain your issue in a better way.
 
target:getLevel() >= 200 then

edit: I don't get what you want to achieve, please explain your issue in a better way.

When we look at players appear Kill and Deaths:
[Kills: 0]
[Deaths: 0]

I need only take Deaths if the player died was lvl 200+

The killer take Kills when he is 200+ (is right)

The death dont is right, he can be a level 8 he will take a Death..

srry bad english, understand?
 
When we look at players appear Kill and Deaths:
[Kills: 0]
[Deaths: 0]

I need only take Deaths if the player died was lvl 200+

The killer take Kills when he is 200+ (is right)

The death dont is right, he can be a level 8 he will take a Death..

srry bad english, understand?
Code:
function onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    if lasthitkiller and lasthitkiller:isPlayer() and creature:getLevel() >= 200 then
        creature:setStorageValue(167913, math.max(0, creature:getStorageValue(167913)) + 1)
    end
    return true
end
 

Similar threads

V
  • Question Question
Replies
0
Views
69
verdehile95
V
Back
Top