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

1 Task Npc (rare)

It works, but when i tried to add one more task, i copied the same script, changed storages, monster and npc name, put SecondQ to login.lua. But it doesnt work, the npc does not count "you have killed 1 rotworm [1/30].
He just says , "okay go kill 30 rotworms".

Help?
 
Code:
 local monsters = {
	--name = storage
	["rotworm"] = 55667,
	["carrion worm"] = 55667
}
local taskmonsterstrv = 55667 -- Monster Storagevalue
local taskmonsters = "rotworms" --- Monsters name (many)
local Npc = "Alex the rotworm slayer" --- The npc name, to return to
local queststrv = 808605 --- Quest storagevalue
local kill = 30 --- How many you need to kill
local killi = "30" --- Becouse the npc can't say 50, it needs to say "50".
 
function onKill(cid, target)
	local monster = monsters[getCreatureName(target):lower()]
	if(isPlayer(target) == FALSE and monster and getPlayerStorageValue(cid, queststrv) == 2) then
		if getPlayerStorageValue(cid, monster) < kill then 
			local killedMonsters = getPlayerStorageValue(cid, monster)
            if(killedMonsters == -1) then
                killedMonsters = 1
			end
			setPlayerStorageValue(cid, monster, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed ".. getPlayerStorageValue(cid, taskmonsterstrv) .." of ".. killi .." ".. taskmonsters ..". [".. getPlayerStorageValue(cid, taskmonsterstrv) .."/".. killi .."]")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed enough ".. taskmonsters ..". Return back to ".. Npc .." for more info.")
			setPlayerStorageValue(cid, queststrv, 3)
		end
	end
	return TRUE
end

and added

Lua:
registerCreatureEvent(cid, "SecondQ")
in login.lua
and
Lua:
 <event type="kill" name="SecondQ" event="script" value="secondq.lua"/>
to xml.

Also made a new npc.. just changed the name.
 
i have 2 problems...
well when using my god char all perfect..

22:54 Grizzly Adams: You have to kill 50 Dragons, 20 Dragon Lords. You want to do it?
22:56 20 / 20 Dragon Lords killed.
22:56 50 / 50 Dragons killed.

if i using normal player lvl 205 not say nothing when I say "mission"

and another thing, I think that does not reward of exp and money.
 
It is... You have just installed the script wrong...

Ps. Everything worked good for me.
 
Hey great script and thanks.

But if I want to add more tasks, change what monster(s) to kill and change the reward(s), where and how do I do it?
Please explain as much as you can, since I'm a noob in scripting. Thanks in advance!

Rep+

- - - Updated - - -

Bump... I really need help with this.
 
Back
Top