• 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!

CreatureEvent Frag's Reward. No Cheat System And Same Ip Can't Get Reward

Owner Maydel

Evolera.Tk
Joined
Aug 16, 2015
Messages
302
Reaction score
40
Location
Egypt
Only Last Hit Can Got The Reward And Same Ip Can;t Take The Reward
Edited By @Cykotitan Tested in 0.4
Code:
function onDeath(cid, corpse, deathList)
   if(isPlayer(cid) == true) then
   if getPlayerIp(cid) ~= getPlayerIp(target) then
     for _, pos in pairs(getArea(getCreaturePosition(cid), 1, 1)) do
       doSendMagicEffect(pos, 65)
     end
     doCreatureSay(cid, getCreatureName(cid) .. " killed by " .. getCreatureName(deathList[1]) .. " [R.I.P]", TALKTYPE_ORANGE_1)
     if isPlayer(deathList[1]) then
       doPlayerAddItem(deathList[1], 2157, 1)
     end
   end
   return true
end
 
Last edited:
Oo We're Sorry I was Upload The Old Script Thats The Truth Script Test Now.
I noticed you just copied a line of code and placed it in the script :p (so you lied :( )
Your script will return 2 errors, 1 for target, because it isn't defined and you are missing an end to complete the new code you placed in the script.

Also you might return other errors.
 
Maybe something like this? ;p

Code:
function onDeath(cid, target, deathList)
    if (isPlayer(cid) and isPlayer(target)) then
        if getPlayerIp(cid) ~= getPlayerIp(target) then
            for _, pos in pairs(getArea(getCreaturePosition(cid), 1, 1)) do
                doSendMagicEffect(pos, 65)
            end
            doCreatureSay(cid, getCreatureName(cid) .. " killed by " .. getCreatureName(deathList[1]) .. " [R.I.P]", TALKTYPE_ORANGE_1)
            doPlayerAddItem(deathList[1], 2157, 1)
        end
    end
    return true
end
 
Very good but what if a fire field or a condition kills the player?
getCreatureName(deathList[1]) will return nil and doPlayerAddItem(deathList[1] will generate an error.
 
Very good but what if a fire field or a condition kills the player?
getCreatureName(deathList[1]) will return nil and doPlayerAddItem(deathList[1] will generate an error.

You should have made the script you posted with configs, now there is like 10 frag reward Scripts posted around in last 24h...
 
You should have made the script you posted with configs, now there is like 10 frag reward Scripts posted around in last 24h...
Doesn't really matter I was just posting the code i created, copied or modified for someone in request or support.
 
Back
Top