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

onKill +3 gold transfer to bank

Nemphis

Veteran OT User
Joined
Jun 22, 2009
Messages
699
Reaction score
441
Location
Sweden
Lets make it simple

I need like 3 groups, lets say rat, troll and skeleton. When you kill a rat(group one) you instantly get +3 gold coins transferred to your personal bank, troll +5 gold transfer to your bank and skeleton +8.
Also when you kill one of these a small text will rise from your characters head and vanish after .5 seconds and say "+3"(the amount that got transferred) in yellow color.


Would this be possible?

distro TFS 0.3.7.
 
Last edited:
Well, I'm retired in OTs but I remember I've done this script before. I'll check if I have.

EDIT: I found.

Code:
local t = {
    ['rat'] = {u = 3},
    ['troll'] = {u = 5},
    ['skeleton'] = {u = 8}
}
function onKill(cid, target, damage, flags)
local k = t[string.lower(getCreatureName(target))]
local m = getCreatureName(target)
local v = (k.u - 20)/100
local s = math.random(v,k.u)
local str = 'You killed '..m..' and won '..s..'!'
local balance = getPlayerBalance(cid)

        if getPlayerStorageValue(cid, 987) == 1 then
            if(k and (damage == true or bit.band(flags, 1) == 1) and isMonster(target)) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
            end
        end
        doPlayerSetBalance(cid, balance + s)
      
    return true
end

Edit this script to fit as you want.
 
Last edited:
Back
Top