• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent NPC Grizzly Adams - almost how RL Tibia.

Today I update scripts without quest log. I think that they have some bugs. When I done it then I refresh this theard.
 
13:25 Grizzly Adams: Welcome back Perflex. What brings you here this time?
13:25 GM [114]: task
13:25 Grizzly Adams: All right, what would you like to hunt? Hydras, sea serpents, behemoths or serpent spawns?
13:25 GM [114]: hydras
13:25 Grizzly Adams: Do you want kill 2000 hydras?
13:25 GM [114]: yes
13:25 Grizzly Adams: Happy hunting, old chap! Come back to me when you are through with your task.
13:25 GM [114]: hi
13:25 Grizzly Adams: Welcome back Perflex. What brings you here this time?
13:25 GM [114]: task

then the server crash :( and still crashing while killing the mobs
 
If you delete this part with your NPC file:
PHP:
elseif isInArray({tasks[i].begin_storage_value, 36}, mainStorage) then
			if mainStorage == tasks[i].begin_storage_value then
				s = "You killed "
				for k,v in pairs(tasks) do
					if getPlayerStorageValue(cid, v.storage) >= 0 then
						count = getPlayerStorageValue(cid, v.storage)
						s = s ..count.." "..v.name.."."
					end
				end
				doNPCTalkALot(cid, 200, {s})
			elseif mainStorage == 36 then
				doNPCTalkALot(cid, 200, {"You killed "..getPlayerStorageValue(cid, 9981).." of 6666 Demons."})
				return true
			end
And try again?
It's 341-354 lines.

And delete:
PHP:
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value and isInArray({-1,0}, killedMonsters) then
	doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
	if totalpoints < 50 then
		doPlayerSetStorageValue(cid, points, totalpoints + 1)
		doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
	end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
	if mob.boss == "no" then
		if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
			doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target)..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target)..".")
				doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
				doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
			end
		end
	elseif mob.boss == "yes" then
		if isInArray({-1,0}, killedMonsters) then
			doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
		end
	end
With creaturescripts file?
 
even after deleting those parts the server still crash while killing a monster, btw the npc does not crash anymore :D


@edit
this script works fine for me, dont crash but is not how RL tibia is, what about you take this script as example:

Lua:
local questCreatures =
{
	["troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Trolls"},
	["frost troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 100, raceName = "Trolls"},
	["furious troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15002, killsRequired = 100, raceName = "Trolls"},
	["island troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15003, killsRequired = 100, raceName = "Trolls"},
	["swamp troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15004, killsRequired = 100, raceName = "Trolls"},
	["troll champion"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15005, killsRequired = 100, raceName = "Trolls"},
	["troll legionnaire"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15006, killsRequired = 100, raceName = "Trolls"},
 
	["goblin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15007, killsRequired = 150, raceName = "Goblins"},
	["goblin assassin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15008, killsRequired = 150, raceName = "Goblins"},
	["goblin leader"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15009, killsRequired = 150, raceName = "Goblins"},
	["goblin scavenger"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15010, killsRequired = 150, raceName = "Goblins"},
 
	["rotworm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15011, killsRequired = 300, raceName = "Rotworms"},
	["carriom worm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15012, killsRequired = 300, raceName = "Rotworms"},
 
	["cyclops"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15013, killsRequired = 500, raceName = "Cyclops"},
	["cyclops smith"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15014, killsRequired = 500, raceName = "Cyclops"},
	["cyclops drone"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15015, killsRequired = 500, raceName = "Cyclops"},
 
 
	["crocodile"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15016, killsRequired = 300, raceName = "Crocodiles"},
 
	["tarantula"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15017, killsRequired = 300, raceName = "Tarantulas"},
 
	["carniphila"] = {questStarted = 1516, questStorage = 65006, creatureStorage = 15018, killsRequired = 150, raceName = "Carniphilas"},
 
	["stone golem"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15019, killsRequired = 200, raceName = "Stone Golems"},
 
	["mammoth"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15020, killsRequired = 300, raceName = "Mammoths"},
 
	["ice golem"] = {questStarted = 1519, questStorage = 65009, creatureStorage = 15021, killsRequired = 300, raceName = "Ice Golems"},
 
	["quara predator scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15022, killsRequired = 300, raceName = "Quaras Scout"},
	["quara constrictor scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15023, killsRequired = 300, raceName = "Quaras Scout"},
	["quara hydromancer scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15024, killsRequired = 300, raceName = "Quaras Scout"},
	["quara mantassin scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15025, killsRequired = 300, raceName = "Quaras Scout"},
	["quara pincher scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15026, killsRequired = 300, raceName = "Quaras Scout"},
 
	["quara predator"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15027, killsRequired = 300, raceName = "Quaras"},
	["quara constrictor"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15028, killsRequired = 300, raceName = "Quaras"},
	["quara hydromancer"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15029, killsRequired = 300, raceName = "Quaras"},
	["quara mantassin"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15030, killsRequired = 300, raceName = "Quaras"},
	["quara pincher"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15031, killsRequired = 300, raceName = "Quaras"},
 
	["water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15032, killsRequired = 70, raceName = "Water Elementals"},
	["roaring water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15033, killsRequired = 70, raceName = "Water Elementals"},
	["slick water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15034, killsRequired = 70, raceName = "Water Elementals"},
	["massive water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15035, killsRequired = 70, raceName = "Water Elementals"},
 
	["earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15036, killsRequired = 70, raceName = "Earth Elementals"},
	["jagged earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15037, killsRequired = 70, raceName = "Earth Elementals"},
	["massive earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15038, killsRequired = 70, raceName = "Earth Elementals"},
	["muddy earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15039, killsRequired = 70, raceName = "Earth Elementals"},
 
	["energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15040, killsRequired = 70, raceName = "Energy Elementals"},
	["charged energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15041, killsRequired = 70, raceName = "Energy Elementals"},
	["massive energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15042, killsRequired = 70, raceName = "Energy Elementals"},
	["overcharged energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15043, killsRequired = 70, raceName = "Energy Elementals"},
 
	["fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15044, killsRequired = 70, raceName = "Fire Elementals"},
	["blazing fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15045, killsRequired = 70, raceName = "Fire Elementals"},
	["blistering fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15046, killsRequired = 70, raceName = "Fire Elementals"},
	["massive fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15047, killsRequired = 70, raceName = "Fire Elementals"},
 
	["mutated rat"] = {questStarted = 1526, questStorage = 65016, creatureStorage = 15048, killsRequired = 200, raceName = "Mutated Rats"},
 
	["giant spider"] = {questStarted = 1527, questStorage = 65017, creatureStorage = 15049, killsRequired = 500, raceName = "Giant Spiders"},
 
	["hydra"] = {questStarted = 1528, questStorage = 65018, creatureStorage = 15050, killsRequired = 2000, raceName = "Hydras"},
 
	["sea serpent"] = {questStarted = 1529, questStorage = 65019, creatureStorage = 15051, killsRequired = 2000, raceName = "Sea Serpents"},
 
	["behemoth"] = {questStarted = 1530, questStorage = 65020, creatureStorage = 15052, killsRequired = 2000, raceName = "Behemoths"},
 
	["serpent spawn"] = {questStarted = 1531, questStorage = 65021, creatureStorage = 15053, killsRequired = 1500, raceName = "Serpents Spawn"},
 
	["green djinn"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15054, killsRequired = 500, raceName = "Green Djinns"},
	["efreet"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15055, killsRequired = 500, raceName = "Green Djinns"},
 
	["blue djinn"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15056, killsRequired = 500, raceName = "Blue Djinns"},
	["marid"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15057, killsRequired = 500, raceName = "Blue Djinns"},
 
	["pirate buccaneer"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15058, killsRequired = 3000, raceName = "Pirates"},
	["pirate corsair"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15059, killsRequired = 3000, raceName = "Pirates"},
	["pirate cutthroat"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15060, killsRequired = 3000, raceName = "Pirates"},
	["pirate ghost"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15061, killsRequired = 3000, raceName = "Pirates"},
	["pirate marauder"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15062, killsRequired = 3000, raceName = "Pirates"},
	["pirate skeleton"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15063, killsRequired = 3000, raceName = "Pirates"},
 
	["pirate buccaneer"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15064, killsRequired = 3000, raceName = "Pirates"},
	["pirate corsair"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15065, killsRequired = 3000, raceName = "Pirates"},
	["pirate cutthroat"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15066, killsRequired = 3000, raceName = "Pirates"},
	["pirate ghost"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15067, killsRequired = 3000, raceName = "Pirates"},
	["pirate marauder"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15068, killsRequired = 3000, raceName = "Pirates"},
	["pirate skeleton"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15069, killsRequired = 3000, raceName = "Pirates"},
 
	["minotaur"] = {questStarted = 1536, questStorage = 65026, creatureStorage = 15070, killsRequired = 5000, raceName = "Minotaurs"},
 
	["necromancer"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"},
	["priestess"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},
 
	["necromancer"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15073, killsRequired = 1000, raceName = "Magicians"},
	["priestess"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15074, killsRequired = 1000, raceName = "Magicians"},
 
	["demon"] = {questStarted = 1539, questStorage = 65029, creatureStorage = 15075, killsRequired = 6666, raceName = "Demons"}
}
 
local msgType = MESSAGE_STATUS_CONSOLE_ORANGE
 
function onKill(cid, target, lastHit)
 
local creature = questCreatures[getCreatureName(target):lower()]
 
	if creature then
		if isPlayer(target) then return true end
 
		if getCreatureStorage(cid, creature.questStarted) > 0 then
			if getCreatureStorage(cid, creature.questStorage) < creature.killsRequired then
				if getCreatureStorage(cid, creature.questStorage) < 0 then
					doCreatureSetStorage(cid, creature.questStorage, 0)
				end
 
				if getCreatureStorage(cid, creature.creatureStorage) < 0 then
					doCreatureSetStorage(cid, creature.creatureStorage, 0)
				end
				doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
				doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)
				doPlayerSendTextMessage(cid, msgType, getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
			end
		end
	end
	return true
end
 
Paste this into creaturecripts:
PHP:
local config = {	
	["carniphila"] = {storage = 9999, mob_storage = 19999, race_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, mob_storage = 19998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, mob_storage = 19997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, mob_storage = 19996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, mob_storage = 19995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, mob_storage = 19994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, mob_storage = 19993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, mob_storage = 19992, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, mob_storage = 19991, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, mob_storage = 19990, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, mob_storage = 19989, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, mob_storage = 19988, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, mob_storage = 19987, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, mob_storage = 19986, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, mob_storage = 19985, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, mob_storage = 19984, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, mob_storage = 19983, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, mob_storage = 19982, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, mob_storage = 19981, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, mob_storage = 19980, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, mob_storage = 19979, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, mob_storage = 19978, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, mob_storage = 19977, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, mob_storage = 19976, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, mob_storage = 19975, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, mob_storage = 19974, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, mob_storage = 19973, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, mob_storage = 19972, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, mob_storage = 19971, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, mob_storage = 19970, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[string.lower(getCreatureName(target))]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local mob_storages = getPlayerStorageValue(cid, mob.mob_storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
	for k, v in pairs(config) do
		if isInArray({-1,0}, getPlayerStorageValue(cid, v.storage)) or getPlayerStorageValue(cid, v.mob_storage) == -1 then
			if getPlayerStorageValue(cid, main_storage) == v.begin_storage_value then
				doPlayerSetStorageValue(cid, v.mob_storage, 0)
				doPlayerSetStorageValue(cid, v.storage, 0)
			end
		end
	end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
	doPlayerSetStorageValue(cid, mob.mob_storage, getPlayerStorageValue(cid, mob.mob_storage) + 1)
		x = 0
		s = "You killed "
		for k, v in pairs(config) do
			if getPlayerStorageValue(cid, main_storage) == v.begin_storage_value then
				if s ~= "You killed " then
					s = s .. " "
				end
				count = getPlayerStorageValue(cid, v.mob_storage)
				if count < 0 then
					count = 0
				end
				s = s ..count.." " .. k .. ","
				x = x + count
			end
		end
		s = string.sub(s, 1, string.len(s) - 1)..". You have killed " .. x .." of ".. mob.count .." "..mob.race_name.."."
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, s)
		if getPlayerStorageValue(cid, mob.storage) == mob.count then 
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
			for k, v in pairs(config) do
				if getPlayerStorageValue(cid, v.storage) == v.count then
					if getPlayerStorageValue(cid, main_storage) == v.finished_storage_value then
						if getPlayerStorageValue(cid, v.mob_storage) >= 0 and getPlayerStorageValue(cid, v.storage) >= 0 then
							doPlayerSetStorageValue(cid, v.mob_storage, -1)
							doPlayerSetStorageValue(cid, v.storage, -1)
						end
					end
				end
			end
			return true
		end
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value and isInArray({-1,0}, killedMonsters) then
	doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
	if totalpoints < 50 then
		doPlayerSetStorageValue(cid, points, totalpoints + 1)
		doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
	end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
	if mob.boss == "no" then
		if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
			doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target)..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target)..".")
				doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
				doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
			end
		end
	elseif mob.boss == "yes" then
		if isInArray({-1,0}, killedMonsters) then
			doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
		end
	end	
end
return true
end

If it don't work good then paste this:
PHP:
local config = {	
	["carniphila"] = {storage = 9999, mob_storage = 19999, race_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, mob_storage = 19998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, mob_storage = 19997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, mob_storage = 19996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, mob_storage = 19995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, mob_storage = 19994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, mob_storage = 19993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, mob_storage = 19992, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, mob_storage = 19991, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, mob_storage = 19990, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, mob_storage = 19989, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, mob_storage = 19988, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, mob_storage = 19987, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, mob_storage = 19986, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, mob_storage = 19985, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, mob_storage = 19984, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, mob_storage = 19983, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, mob_storage = 19982, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, mob_storage = 19981, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, mob_storage = 19980, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, mob_storage = 19979, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, mob_storage = 19978, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, mob_storage = 19977, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, mob_storage = 19976, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, mob_storage = 19975, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, mob_storage = 19974, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, mob_storage = 19973, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, mob_storage = 19972, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, mob_storage = 19971, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, mob_storage = 19970, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[string.lower(getCreatureName(target))]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local mob_storages = getPlayerStorageValue(cid, mob.mob_storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
	for k, v in pairs(config) do
		if isInArray({-1,0}, getPlayerStorageValue(cid, v.storage)) or getPlayerStorageValue(cid, v.mob_storage) == -1 then
			if getPlayerStorageValue(cid, main_storage) == v.begin_storage_value then
				doPlayerSetStorageValue(cid, v.mob_storage, 0)
				doPlayerSetStorageValue(cid, v.storage, 0)
			end
		end
	end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
	doPlayerSetStorageValue(cid, mob.mob_storage, getPlayerStorageValue(cid, mob.mob_storage) + 1)
		x = 0
		s = "You killed "
		for k, v in pairs(config) do
			if getPlayerStorageValue(cid, main_storage) == v.begin_storage_value then
				if s ~= "You killed " then
					s = s .. " "
				end
				count = getPlayerStorageValue(cid, v.mob_storage)
				if count < 0 then
					count = 0
				end
				s = s ..count.." " .. k .. ","
				x = x + count
			end
		end
		s = string.sub(s, 1, string.len(s) - 1)..". You have killed " .. x .." of ".. mob.count .." "..mob.race_name.."."
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, s)
		if getPlayerStorageValue(cid, mob.storage) == mob.count then 
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
			return true
		end
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value and isInArray({-1,0}, killedMonsters) then
	doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
	if totalpoints < 50 then
		doPlayerSetStorageValue(cid, points, totalpoints + 1)
		doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
	end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
	if mob.boss == "no" then
		if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
			doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target)..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target)..".")
				doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
				doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
			end
		end
	elseif mob.boss == "yes" then
		if isInArray({-1,0}, killedMonsters) then
			doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
		end
	end	
end
return true
end
 
both crash the server :(

what about this code?

Lua:
local msgType = MESSAGE_STATUS_CONSOLE_ORANGE
 
function onKill(cid, target, lastHit)
 
local creature = questCreatures[getCreatureName(target):lower()]
 
	if creature then
		if isPlayer(target) then return true end
 
		if getCreatureStorage(cid, creature.questStarted) > 0 then
			if getCreatureStorage(cid, creature.questStorage) < creature.killsRequired then
				if getCreatureStorage(cid, creature.questStorage) < 0 then
					doCreatureSetStorage(cid, creature.questStorage, 0)
				end
 
				if getCreatureStorage(cid, creature.creatureStorage) < 0 then
					doCreatureSetStorage(cid, creature.creatureStorage, 0)
				end
				doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
				doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)
				doPlayerSendTextMessage(cid, msgType, getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
			end
		end
	end
	return true
end

cant you make your code like this? this works fine :D
 
Last edited by a moderator:
If you want. Take:
PHP:
local config = {	
	["carniphila"] = {storage = 9999, ace_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[string.lower(getCreatureName(target))]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
		if getPlayerStorageValue(cid, mob.storage) == mob.count then 
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." "..mob.race_name..".")
		end
		return true
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value and isInArray({-1,0}, killedMonsters) then
	doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
	if totalpoints < 50 then
		doPlayerSetStorageValue(cid, points, totalpoints + 1)
		doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
	end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
	if mob.boss == "no" then
		if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
			doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target)..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target)..".")
				doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
				doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
			end
		end
	elseif mob.boss == "yes" then
		if isInArray({-1,0}, killedMonsters) then
			doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
		end
	end	
end
return true
end
 
still crashing :( i dont know what to do anymore :( i want too much this npc on my server =/
 
XML:
	<event type="kill" name="Grizzly_Adams" event="script" value="Grizzly_Adams.lua"/>

Lua:
	registerCreatureEvent(cid, "Grizzly_Adams")
	return true
end
 
Last edited by a moderator:
Last attempt.
Try this creaturescript file:
PHP:
local config = {	
	["carniphila"] = {storage = 9999, ace_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[getCreatureName(target)]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
		if getPlayerStorageValue(cid, mob.storage) == mob.count then 
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." "..mob.race_name..".")
		end
		return true
end
return true
end
If it doesn't work then I don't know how can I help you.
 
now does not crash!!! xD but does not show the msg "you killed blablabla..." :( but DONT CRASH xD the only problem now is the msg
 
Try it:
PHP:
local config = {	
	["carniphila"] = {storage = 9999, ace_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[getCreatureName(target)]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
		if getPlayerStorageValue(cid, mob.storage) == mob.count then 
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "mob.count" "..mob.race_name..".")
		end
end
return true
end
If work good then paste this:
PHP:
local config = {	
	["carniphila"] = {storage = 9999, ace_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[getCreatureName(target)]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
		if getPlayerStorageValue(cid, mob.storage) == mob.count then 
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "mob.count" "..mob.race_name..".")
		end
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value and isInArray({-1,0}, killedMonsters) then
	doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
	if totalpoints < 50 then
		doPlayerSetStorageValue(cid, points, totalpoints + 1)
		doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
	end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
	if mob.boss == "no" then
		if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
			doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target)..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target)..".")
				doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
				doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
			end
		end
	elseif mob.boss == "yes" then
		if isInArray({-1,0}, killedMonsters) then
			doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
		end
	end	
end
return true
end
 
the first does not show the msg yet :( and the second give this error in console:

[16:2:26.499] [Error - LuaInterface::loadFile] data/creaturescripts/scripts/Grizzly_Adams.lua:89: ')' expected near 'mob'
[16:2:26.499] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/Grizzly_Adams.lua)
[16:2:26.500] data/creaturescripts/scripts/Grizzly_Adams.lua:89: ')' expected near 'mob'
 
Paste this, again xd :
PHP:
local config = {	
	["carniphila"] = {storage = 9999, ace_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[getCreatureName(target)]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
		if getPlayerStorageValue(cid, mob.storage) == mob.count then 
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..mob.race_name..".")
		end
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value and isInArray({-1,0}, killedMonsters) then
	doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
	if totalpoints < 50 then
		doPlayerSetStorageValue(cid, points, totalpoints + 1)
		doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
	end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
	if mob.boss == "no" then
		if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
			doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target)..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target)..".")
				doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
				doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
			end
		end
	elseif mob.boss == "yes" then
		if isInArray({-1,0}, killedMonsters) then
			doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
		end
	end	
end
return true
end
 
mhmm, somehow the npc doesnt works correctly :O
using the newest 0.4 rev.

picturepx.jpg
 
@up
u need to add the function doNPCTalkAlot to the lib folder

@topic
still the same :( does not show =/ man i'm almost crying IRL xD i want this script so badly, i'm trying to get it working for almost 3 days already :(
 
Last edited by a moderator:
PHP:
local config = {	
	["carniphila"] = {storage = 9999, ace_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
	["crocodile"] = {storage = 9998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
	["tarantula"] = {storage = 9997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
	["stone golem"] = {storage = 9996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
	["mammoth"] = {storage = 9995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},

	["ice golem"] = {storage = 9994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},

	["quara constrictor scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara hydromancer scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara mantassin scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara pincher scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	["quara predator scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
	
	["quara constrictor"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara hydromancer"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara mantassin"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara pincher"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
	["quara predator"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},

	["fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
	["massive fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},

	["water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
	["massive water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},

	["earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
	["massive earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},

	["energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	["massive energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
	
	["mutated rat"] = {storage = 9987, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
	["giant spider"] = {storage = 9986, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},

	["hydra"] = {storage = 9985, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
	["sea serpent"] = {storage = 9984, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
	["behemoth"] = {storage = 9983, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
	["serpent spawn"] = {storage = 9982, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},

	["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
	
	--bosses
	["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
	
	["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
	["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
	["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
	["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
	["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
	["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
	["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
	["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
	["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
	["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
	["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
	}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003

function onKill(cid, target)
local mob = config[getCreatureName(target)]
if not(mob and isPlayer(target) ~= true) then
	return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
	totalpoints = 0
end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value and killedMonsters <= mob.count then
	doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..mob.race_name..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
			doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
				if totalpoints < 50 then
					if mob.count < 1500 then
						doPlayerSetStorageValue(cid, points, totalpoints + 1)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					else
						doPlayerSetStorageValue(cid, points, totalpoints + 3)
						doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
					end
				end
			end
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value and isInArray({-1,0}, killedMonsters) then
	doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
	if totalpoints < 50 then
		doPlayerSetStorageValue(cid, points, totalpoints + 1)
		doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")	
	end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
	if mob.boss == "no" then
		if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
			doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target)..".")
			if getPlayerStorageValue(cid, mob.storage) == mob.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target)..".")
				doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
				doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
			end
		end
	elseif mob.boss == "yes" then
		if isInArray({-1,0}, killedMonsters) then
			doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
		end
	end	
end
return true
end

xd
I change some functions, but I don't know whether it will work. Try again.
 
Back
Top