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

Kill Monsters = setStorageValue

Reyn

On to the next One
Joined
May 15, 2010
Messages
259
Reaction score
1
Location
Germany ;3
Hei all :eek:
i'm looking for a script which works like this:
If I kill 1-100 (math. random) Demons it gives me a storage Value ... and it shouldnt be repeatable.. If possible after finishing this quest there should appear a FYI which says (you just killed a lot of Demons, you can do the demon quest now) or sth. xDD but isn't needed!
it shouldnt be startet with a quest npc or so... it should just appear after killing that amount of monsters
I hope someone can help me!
REgards,
Reyn
EDIT: It should work for tfs 0.3.6pl1
EDITEDIT: i got this script already (original by Teckman or so) just edited a bit
Code:
function onKill(cid, target) 

local config = { 
monstername = "demon", -- monster name 
needeedkills = 5, -- kills needed to complete quest 
effect = 15, -- effect used after completing quest 
storage = 10001, -- storage of kills 
hunterstorage = 9999, -- storage of completed quest 
pos = getPlayerPosition(cid) -- replacement for cid is target 
} 
        if(isMonster(target) == TRUE) then 
            if getCreatureName(target) == config.monstername then 
                if getPlayerStorageValue(cid, config.storage) == config.needeedkills-1 and getPlayerStorageValue(cid,config.hunterstorage) == -1 then 
                    doCreatureSay(cid, ""..config.monstername.." just joined your Team.", TALKTYPE_ORANGE_1) 
                    setPlayerStorageValue(cid,config.hunterstorage,1) 
                    doSendMagicEffect(config.pos, config.effect)  
                elseif getPlayerStorageValue(cid, config.storage) < config.needeedkills-1 then 
                    setPlayerStorageValue(cid, config.storage,(getPlayerStorageValue(cid, config.storage))+1) 
                end 
            end 
        end 
    return TRUE 
end
but anyhow it doesnt work for me :S no errors in console it just doesnt give me the Message if i killed 5 demons PLUS there is no math.random at the kills :S
 
Last edited:
Ahh yeah i know what u mean now ^^ yeah didn't forget it thanks :D
EDIT:
thats what im using, is this right?
Code:
			queststatusA = getPlayerStorageValue(cid,1212)
			if queststatusA == 1 then
 
Last edited:
Lua:
			local queststatusA = getPlayerStorageValue(cid,1212)
			if queststatusA == 1 then
local variable doesn't cause lag to your server, always use it :)
-1 = EMPTY_STORAGE
if queststatusA == -1 then

Rep+
 
Back
Top