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

REP++ for help

Fidgitz444

Banned User
Joined
Feb 24, 2014
Messages
215
Reaction score
55
Hi my friend compiled my ot yesterday from fresh and its TFS VErsion 0.4
but i got a problem with my script Before the compiled it waas working
my server is a war server say if somebody is 80 (Starting level) kills a 130 he will get much EXP i dont want t his i want him to get NO EXP at all from somebody who is around 25+ levels higher

Thanks
 
Here is something you can play with, a creaturescript I made for EldinWorld deathmatch server some time ago:
LUA:
function onKill(cid, target, damage, flags)
    local totalFragStorage = 30001 -- storage value to count total frags
    local currentFragStorage = 30002 -- storage value to count current frags
    local percent = 7
  
    if(isPlayer(cid) and isPlayer(target)) then
  
        local expgain = (getPlayerExperience(target) / 100) * percent
        local t_lvl = getPlayerLevel(target)
      
        if getPlayerIp(cid) == getPlayerIp(target) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You killed your friend! No reward for you!")
        else
            -- Give exp and gold coin
            doPlayerAddExp(cid, expgain)
            doPlayerAddItem(cid, 2148, t_lvl)
            -- And if he is the main killer, give a talon
            if(flags % 2 == 1) then
                doPlayerAddItem(cid, 2151, 1)
                setPlayerStorageValue(cid, totalFragStorage, (getPlayerStorageValue(cid, totalFragStorage) + 1))
                setPlayerStorageValue(cid, currentFragStorage, (getPlayerStorageValue(cid, currentFragStorage) + 1))
                if getPlayerStorageValue(cid, totalFragStorage) < 1 and getPlayerStorageValue(cid, currentFragStorage) < 1 then -- Incase its their first frag, default is -1 so it needs an additional point to sum up.
                    setPlayerStorageValue(cid, totalFragStorage, (getPlayerStorageValue(cid, totalFragStorage) + 1))
                    setPlayerStorageValue(cid, currentFragStorage, (getPlayerStorageValue(cid, currentFragStorage) + 1))
                end
                -- Reset current frags for the victim
                setPlayerStorageValue(target, currentFragStorage, 0)
              
                -- Frag announcer
                if getPlayerStorageValue(cid, currentFragStorage) == 1 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"First Blood! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")          
                    doCreatureSay(cid, "First Blood!", TALKTYPE_ORANGE_1)
                elseif getPlayerStorageValue(cid, currentFragStorage) == 2 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Double Kill!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")          
                    doCreatureSay(cid, "Double Kill!!", TALKTYPE_ORANGE_1)
                elseif getPlayerStorageValue(cid, currentFragStorage) == 3 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Triple Kill!!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")          
                    doCreatureSay(cid, "Triple Kill!!!", TALKTYPE_ORANGE_1)
                elseif getPlayerStorageValue(cid, currentFragStorage) == 4 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"MULTI KILL! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
                    doCreatureSay(cid, "MULTI KILL!", TALKTYPE_ORANGE_1)
                elseif getPlayerStorageValue(cid, currentFragStorage) == 5 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"ULTRA KILL!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
                    doCreatureSay(cid, "ULTRA KILL!!", TALKTYPE_ORANGE_1)
                elseif getPlayerStorageValue(cid, currentFragStorage) == 5 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"MONSTER KILL!!! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
                    doCreatureSay(cid, "MONSTER KILL!!!", TALKTYPE_ORANGE_1)              
                elseif getPlayerStorageValue(cid, currentFragStorage) >= 7 and getPlayerStorageValue(cid, currentFragStorage) < 9 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Another One...! INSANE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
                    doCreatureSay(cid, "Another One...! INSANE!", TALKTYPE_ORANGE_1)  
                elseif getPlayerStorageValue(cid, currentFragStorage) == 10 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"UNSTOPABLE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
                    doCreatureSay(cid, "UNSTOPABLE!", TALKTYPE_ORANGE_1)              
                elseif getPlayerStorageValue(cid, currentFragStorage) >= 11 and getPlayerStorageValue(cid, currentFragStorage) < 19 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"MWUAHAHA! OWNAGE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
                    doCreatureSay(cid, "MWUAHAHA! OWNAGE!", TALKTYPE_ORANGE_1)
                elseif getPlayerStorageValue(cid, currentFragStorage) == 20 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"GODLIKE! "..getPlayerStorageValue(cid, currentFragStorage).." frags!")          
                    doCreatureSay(cid, "GODLIKE!", TALKTYPE_ORANGE_1)          
                elseif getPlayerStorageValue(cid, currentFragStorage) >= 21 then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You are the chosen one. "..getPlayerStorageValue(cid, currentFragStorage).." frags!")
                    doCreatureSay(cid, "Im the chosen one!", TALKTYPE_ORANGE_1)
                end
              
                -- Broadcast
                if getPlayerStorageValue(cid, currentFragStorage) == 10 then
                    broadcastMessage(getCreatureName(cid).." is UNSTOPABLE!!")
                elseif getPlayerStorageValue(cid, currentFragStorage) == 20 then
                    broadcastMessage(getCreatureName(cid).." is GODLIKE!!")
                end
              
            end
        end
    end
    return true
end
-- function onDeath(cid, corpse, deathList)
-- local cidpos = getPlayerPosition(deathList[1])

You can probably remove the frag counting, messaging and broadcasting system and add something along these lines instead:
LUA:
if getPlayerLevel(target) > getPlayerLevel(cid) + 25 then
-- add exp and stuff her~
end
 

Similar threads

Back
Top