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

Reward For Frag

Yaboihunna

New Member
Joined
Mar 27, 2019
Messages
136
Reaction score
3
Requesting a script 1 platinum coin per frag
aswell as -2000 experience for killing a person with the same ip
couldn't seem to find one that works I'm using tfs 0.4
 
yes that's possible for some reason my frag reward is bugged it should work though :p I seen a thread of hearts and trophy somewhere in the mist of trying to find my frag reward
 
Try this one as frag reward without IP punish.
fragreward.lua
Lua:
local config = {item = 2152, count = 5, killers = 1}
function onDeath(creature, corpse, lasthitkiller)
for i = 1, config.killers do
    doPlayerAddItem(lasthitkiller[i],config.item,config.count)
end
    return true
end
creaturescripts.xml
XML:
<event type="death" name="Reward" script="fragreward.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "Reward")
and then try this one for punish
fragreward2.lua
Lua:
function onKill(cid, target, lastHit)
    if cid ~= target and isPlayer(target) then
    if getPlayerIp(cid) == getPlayerIp(target) then
        doPlayerAddExperience(cid, -500)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
    else
        doPlayerAddItem(cid, 2152, 1)
        doPlayerAddExperience(cid, 500)
        doSendAnimatedText(getPlayerPosition(cid),"500", TEXTCOLOR_WHITE)
        end
    end
return true
end
creaturescripts.xml
XML:
<event type="kill" name="FragReward2" value="fragreward2.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "FragReward2")
If not then you can try something like a reward on dead body

fragreward3.lua
Lua:
function onDeath(cid, corpse, deathList)
    if isPlayer(cid) then
        local v = { killer_name = getCreatureName(deathList[1]), killer_level = getPlayerLevel(deathList[1]), target_name = getCreatureName(cid), target_level = getPlayerLevel(cid) }
        local reward = doAddContainerItem(corpse.uid, 5943, 1)
        doItemSetAttribute(reward, "description", "" .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed at level " .. v.target_level .. " by " .. v.killer_name .. " who was level " .. v.killer_level .. " at the time. " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "[Unjustified]" or "[Justified]"))
        doItemSetAttribute(reward, "name", v.target_name .."'s Heart")
    end
    return true
end
creaturescripts.xml
XML:
<event type="death" name="FragReward3" value="fragreward3.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "FragReward3")
 
Back
Top