• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Frag Reward

Saint Spear

Veteran OT User
Joined
Jun 22, 2016
Messages
1,547
Solutions
18
Reaction score
379
Hello
Well, My Request-Question is simple.
I need a script which works like this
1 kill ( frag ) gives you 5 platinum coins
Searched alot through Otland, google and other tibia sites, Didnt found any script which works for me..
I'm using TFS 0.3.6
Thanks !
 
Solution
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")
open date creatureevent/scripts.. and make new file name fragsreward and then add this in file
Code:
local level = 10
function onKill(cid, target, lastHit)
    if (isPlayer(cid) and isPlayer(target)) then
        if (getPlayerLevel(cid) + level) < getPlayerLevel(target) then
            if getPlayerIp(cid) ~= getPlayerIp(target) then
                local create = doPlayerAddItem(cid, 7369, 1)   --- change this for   platinum coins and amount
                doItemSetAttribute(create, 'description', "Trofeo por matar a "..getPlayerName(target).." en level "..getPlayerLevel(target).." cuando tu eras level "..getPlayerLevel(cid)..".")
                doPlayerSendTextMessage(cid, 24, "Te ganaste un trofeo por matar un player con lvl más alto que el tuyo.")
            end
        end
    end
    return true
end

and then open creatureevent.xml and add this
<event type="Kill" name="fragsreward" event="script" value=fragsreward.lua"/>

and in file login add
registerCreatureEvent(cid, "fragsreward")

notice
this script don't work for same ip
 
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")
 
Last edited:
Solution
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")
Thanks
 
Back
Top