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

Is it Possible to create a pvp-e script with kill counter?

matti450

Member
Joined
Apr 13, 2008
Messages
507
Reaction score
24
I was wondring if it is possible to create a script or edit in lua so that the world is pvp- e but you stil get frags when a player kill a player? until t.e.x 45 frags and then it will reset the frag system to normal pvp if someone kills 3 ppl he will gain rs ?
 
I've just grabbed this script out of my data pack release
https://otland.net/threads/10-77-tf...-spiritual-successor-to-simple-war-ot.234453/

You could alter and/or add to this script, perhaps include a skull system?
Hope this helps anyway

Code:
dofile("war_config.lua")

-- CREDIT TO NINJA @ OTLAND FOR THE BASE SCRIPT
-- REF: https://otland.net/threads/tfs-1-0-experience-from-killing-higher-level-players.212691/#post-2039964

function onKill(cid, target, lastHit)

    local attackPlayer = Player(target)

    local reward = {
            item = rewardItem,
            count = rewardCount
            }

    if not attackPlayer then
        return true
    end

    for id, damage in pairs(attackPlayer:getDamageMap()) do
        local player = Player(id)
        if player then
            if player:getIp() ~= target:getIp() then
                local experience = attackPlayer:getExperience()
                local expFormula = (experience * expMultiplier)
                local bonusExpFormula = (experience * bonusExpMultiplier)

                player:addExperience(math.floor(expFormula), true)
                player:addItem(reward.item, reward.count)
                player:setStorageValue(fragStor, player:getStorageValue(fragStor) + 1)

                if player:getStorageValue(doubleFragRewardStor) >= 1 then
                    player:addItem(reward.item, reward.count)
                    player:setStorageValue(doubleFragRewardStor, player:getStorageValue(doubleFragRewardStor) -1)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "Bonus frag reward added! " .. player:getStorageValue(doubleFragRewardStor) .. " bonus frags remaining!")

                end
                if player:getLevel() <= maximumLevel and player:getStorageValue(extraExpStor) >= 1 then
                    player:addExperience(math.floor(bonusExpFormula), true)
                    player:setStorageValue(extraExpStor, player:getStorageValue(extraExpStor) - 1)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "Bonus frag EXP added! " .. player:getStorageValue(extraExpStor) .. " bonus frags remaining!")
                end
            end
        end
    end
end
 
I've just grabbed this script out of my data pack release
https://otland.net/threads/10-77-tf...-spiritual-successor-to-simple-war-ot.234453/

You could alter and/or add to this script, perhaps include a skull system?
Hope this helps anyway

Code:
dofile("war_config.lua")

-- CREDIT TO NINJA @ OTLAND FOR THE BASE SCRIPT
-- REF: https://otland.net/threads/tfs-1-0-experience-from-killing-higher-level-players.212691/#post-2039964

function onKill(cid, target, lastHit)

    local attackPlayer = Player(target)

    local reward = {
            item = rewardItem,
            count = rewardCount
            }

    if not attackPlayer then
        return true
    end

    for id, damage in pairs(attackPlayer:getDamageMap()) do
        local player = Player(id)
        if player then
            if player:getIp() ~= target:getIp() then
                local experience = attackPlayer:getExperience()
                local expFormula = (experience * expMultiplier)
                local bonusExpFormula = (experience * bonusExpMultiplier)

                player:addExperience(math.floor(expFormula), true)
                player:addItem(reward.item, reward.count)
                player:setStorageValue(fragStor, player:getStorageValue(fragStor) + 1)

                if player:getStorageValue(doubleFragRewardStor) >= 1 then
                    player:addItem(reward.item, reward.count)
                    player:setStorageValue(doubleFragRewardStor, player:getStorageValue(doubleFragRewardStor) -1)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "Bonus frag reward added! " .. player:getStorageValue(doubleFragRewardStor) .. " bonus frags remaining!")

                end
                if player:getLevel() <= maximumLevel and player:getStorageValue(extraExpStor) >= 1 then
                    player:addExperience(math.floor(bonusExpFormula), true)
                    player:setStorageValue(extraExpStor, player:getStorageValue(extraExpStor) - 1)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "Bonus frag EXP added! " .. player:getStorageValue(extraExpStor) .. " bonus frags remaining!")
                end
            end
        end
    end
end
i will try this one out, thx mate
 
Back
Top