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

RevScripts Simple Task Points

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
549
Solutions
1
Reaction score
58
Location
Lo Mochis, Sinaloa
Lua:
local CusMons = CreatureEvent("CusMons")

function CusMons.onKill(player, target)
    
local config = { -- Use missionStorage to link the monsters to each mission. It is set up this way so multiple missions can have the same monsters.
    [1] = {name = "Rat",, missionStorage = 43000, storage = 41000},
    [2] = {name = "Cave Rat",, missionStorage = 43000, storage = 41001},
    [3] = {name = "Troll", missionStorage = 43001, storage = 41002}
}

        if target:isPlayer() or target:getMaster() then
            return true
        end
        for i = 1, #config do
            if target:getName() == config[i].name then
                local storage = player:getStorageValue(config[i].missionStorage)
                if storage >= 0 and storage < 200 then
                    player:setStorageValue(config[i].missionStorage, player:getStorageValue(config[i].missionStorage) + 1)
                end
            end
        end
    return true
end

CusMons:register()

hello, I'm trying to make a revscript of a points system for kill of each monster that is in the table, could you help me? I try to get storage 43000 to add a point but it doesn't do anything by killing the rat.

I apologize in advance for my English.
 
Back
Top