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

Solved Function onDeath add storagevalue

Shackal

Alien Project
Joined
Feb 7, 2009
Messages
211
Reaction score
17
Location
Brazil
Hello guys,

I'm using Dev 0.4
I wonder what's wrong in my script:

Code:
local c = {
    storage = 1889,
    storageValueToCheckFor = 31
}

function onDeath(cid, corpse, killer)
    if getPlayerStorageValue(killer, c.storage) == c.storageValueToCheckFor then
        setPlayerStorageValue(killer, c.storage, c.storageValueToCheckFor + 1)
    end
end

In my distro, returns the following error:

Code:
[Error - CreatureScript Interface]
data/creaturescripts/inq/ungreez.lua:onDeath
Description:
(luaGetCreatureStorage) Creature not found

But if already I configured an event in monster/Ungreez.lua, why not find?

Thank you in advance!
 
Last edited:

No probbly not, but they work pretty much the same way, if the monster name can be found in the array => get the array variable and make something with it. In this case loop the attackers to give them a storage value.
Yes but alot of ppl still use that system on 1.0 and diden't notice the 0.4 :p
 
Code:
function onKill(cid, target)
    if string.lower(getCreatureName(target) == string.lower("ungreez") then
        if getCreatureStorage(cid, 1889) == 19 then
            doCreatureSetStorage(cid, 1889, 20)
        end
    end
return true
end

There's zero reason this should not work. If it does not, that means you either haven't registered things correctly, or you just need to restart your server.
SOLVED!!
Thank so much you all !!
 
Last edited:
Back
Top