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

Item for Death

erceiha

New Member
Joined
Sep 16, 2010
Messages
10
Reaction score
0
Hi all,
I have a problem with the rewrite script, my question: It gave advice to rewrite the script that when a player is killed getting to Item but after killing 30 + lvl was getting to be different?
Sorry for my English.

local config = {
id = 5953,
count = 1
}
function onKill(cid, target, lastHist)
if isPlayer(target) == true then
doPlayerAddItem(cid,config.id, config.count)
end
return true
end
 
What?
Lua:
local config = {
    id = 5953,
    count = 1
}

function onKill(cid, target, lastHit)
    if isPlayer(cid) and isPlayer(target) and lastHit then
        if getPlayerIp(cid) ~= getPlayerIp(target) then
            doPlayerAddItem(cid, config.id, config.count)
        end
    end
    return true
end
 
Lua:
local first = 5953
local second = 3435 --itemid if killed player is > 30
 
function onKill(cid, target, lastHit)
    if isPlayer(cid) and isPlayer(target) and lastHit then
        if getPlayerIp(cid) ~= getPlayerIp(target) then
            doPlayerAddItem(cid, getPlayerLevel(target) > 30 and second or first, 1)
        end
    end
    return true
end
 
doesn't work your script;/ character when kill nothing come to his bp.
this work but i have a errors in terminal. ;/
ocal config = {
id = 5953,
id2 = 5953, -- id cukierka
count = 1
}
function onKill(cid, target, lastHist)
local level = getPlayerLevel(target)
if isPlayer(target) == true and level < 30 then
doPlayerAddItem(cid,config.id, config.count)
else
doPlayerAddItem(cid,config.id2, config.count)
end
return true
end

errors:
[Error - CreatureScript Interface]
data/creaturescripts/scripts/playerkill.lua:eek:nKill
Description:
(internalGetPlayerInfo) Player not found when requesting player info #3
 
Back
Top