this line avoid that but idk why it doesnt work for you as expectedHi, this is working great in TFS 0.4 8.6
But summoned monsters count as part of the task.
What do I have to do in order to avoid that? Thanks!
if isPlayer(target) or isSummon(target) then return true end
Took a little while.. and I have no idea if there are bugs.. or if this is how the quest even works.. but I tried. xDBy the way, does anyone know if there's a talkaction to check your current tasks?
Like: !tasks = Your current tasks are: Trolls: 100/300 Rotworms: 20/300
Thanks again
local t = {
[1] = {start = 1510, kills = 100, storages = {15000, 15001, 15002, 15003, 15004, 15005, 15006}, race = "Trolls" },
[2] = {start = 1511, kills = 150, storages = {15007, 15008, 15009, 15010}, race = "Goblins" },
[3] = {start = 1512, kills = 300, storages = {15011, 15012}, race = "Rotworms" },
[4] = {start = 1513, kills = 500, storages = {15013, 15014, 15015}, race = "Cyclops" },
[5] = {start = 1514, kills = 300, storages = {15016}, race = "Crocodiles" },
[6] = {start = 1515, kills = 300, storages = {15017}, race = "Tarantulas" },
[7] = {start = 1516, kills = 150, storages = {15018}, race = "Carniphilas" },
[8] = {start = 1517, kills = 200, storages = {15019}, race = "Stone Golems" },
[9] = {start = 1518, kills = 300, storages = {15020}, race = "Mammoths" },
[10] = {start = 1519, kills = 300, storages = {15021}, race = "Ice Golems" },
[11] = {start = 1520, kills = 300, storages = {15022, 15023, 15024, 15025, 15026}, race = "Quaras Scouts" },
[12] = {start = 1521, kills = 300, storages = {15027, 15028, 15029, 15030, 15031}, race = "Quaras" },
[13] = {start = 1522, kills = 70, storages = {15032, 15033, 15034, 15035}, race = "Water Elementals" },
[14] = {start = 1523, kills = 70, storages = {15036, 15037, 15038, 15039}, race = "Earth Elementals" },
[15] = {start = 1524, kills = 70, storages = {15040, 15041, 15042, 15043}, race = "Energy Elementals" },
[16] = {start = 1525, kills = 70, storages = {15044, 15045, 15046, 15047}, race = "Fire Elementals" },
[17] = {start = 1526, kills = 200, storages = {15048}, race = "Mutated Rats" },
[18] = {start = 1527, kills = 500, storages = {15049}, race = "Giant Spiders" },
[19] = {start = 1528, kills = 2000, storages = {15050}, race = "Hydras" },
[20] = {start = 1529, kills = 2000, storages = {15051}, race = "Sea Serpents" },
[21] = {start = 1530, kills = 2000, storages = {15052}, race = "Behemoths" },
[22] = {start = 1531, kills = 1500, storages = {15053}, race = "Serpent Spawns" },
[23] = {start = 1532, kills = 500, storages = {15054, 15055}, race = "Green Djinns" },
[24] = {start = 1533, kills = 500, storages = {15056, 15057}, race = "Blue Djinns" },
[25] = {start = 1534, kills = 3000, storages = {15058, 15059, 15060, 15061, 15062, 15063}, race = "Pirates" },
[26] = {start = 1535, kills = 3000, storages = {15064, 15065, 15067, 15068, 15069}, race = "Pirates - Repeatable" },
[27] = {start = 1536, kills = 5000, storages = {15070}, race = "Minotaurs" },
[28] = {start = 1537, kills = 4000, storages = {15071, 15072}, race = "Magicians" },
[29] = {start = 1538, kills = 1000, storages = {15073, 15074}, race = "Magicians - Repeatable" },
[30] = {start = 1539, kills = 6666, storages = {15075}, race = "Demons" },
}
function onSay(cid, words, param)
local str = ""
for i = 1, #t do
if getPlayerStorageValue(cid, t[i].start) < 1 then
str = str .. "" .. t[i].race .. " not started.\n"
elseif getPlayerStorageValue(cid, t[i].start) == 1 then
local count = 0
for n = 1, #t[i].storages do
count = count + getPlayerStorageValue(cid, t[i].storages[n])
end
str = str .. "" .. t[i].race .. " " .. count .. "/" .. t[i].kills .. " killed.\n"
else
str = str .. "" .. t[i].race .. " completed.\n"
end
end
doShowTextDialog(cid, 1987, str)
return true
end
Right, you could do that.@Xikini arent all task monsters defined in the original script already? couldve saved time and just made that table global instead of creating another table that looks the same
Your talkactions.xml should look something like this@Xikini I tested out the script, it looks awesome! but is not working it does not show if I started the task, it says "Crocodiles not started", also has an error in console " Cant find race 'crocodiles' " or the started task when I killed a monster.
BTW I really apreciate the time and work yo do. I don't need something that cool or difficult, maybe something more simple, like a text in deffault channel where it says "You haven't start any tasks yet" if the player has no tasks And if the player has started tasks it says "Tasks started: Crocodiles: 100/300, Trolls: 40/50" something like that that doesn't show all the tasks.
Thank you very much, and sorry if I'm being rude or something.
Excuse my english.
Regards!
<talkaction words="/testt" event="script" value="testt.lua"/>
<talkaction words="/task" event="script" value="task.lua"/>
I've looked over the script multiple times, and read through the npc multiple times.. I can't see where I've gone wrong.Here's the talkaction in fileand the file in data/talkactions/script has the same name as value.Code:<talkaction words="/task" event="script" value="task.lua"/>
I copied your script again, now is not giving errors in console but even when I already started the task, it says "Trolls not started" and I've started the task since I'm getting the counting in the default channel.
I'm using TFS 0.4 - 8.6
data/npc/scripts/killinginthenameof.lua:96: attempt to call global 'getCreatureStorage' (a nil value)
stack traceback:
data/npc/scripts/killinginthenameof.lua:96: in function 'callback'
data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay'
data/npc/scripts/killinginthenameof.lua:77: in function <data/npc/scripts/killinginthenameof.lua:77>
Thanks for answer but i did task system by myselfchange getCreatureStorage
to
getCreatureStorageValue
Lua Script Error: [Npc interface]
data/npc/scripts/killinginthenameof.lua:onCreatureSay
data/npc/scripts/killinginthenameof.lua:61: attempt to call global 'getCreatureStorage' (a nil value)
for i = 1, table.maxn(tasks) do
text = text .. "\n" .. i .. " - " .. tasks[i].raceName .. (getCreatureStorage(cid, tasks[i].questStarted) == 2 and " [Done]" or "")
end
getCreatureStorage = getPlayerStorageValue
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/killinginthenameof.lua:onKill
data/creaturescripts/scripts/killinginthenameof.lua:127: attempt to call global 'doPlayerSetStorageValue' (a nil value)
if getCreatureStorage(cid, creature.questStorage) < 0 then
doCreatureSetStorage(cid, creature.questStorage, 0)
end
if getCreatureStorage(cid, creature.creatureStorage) < 0 then
doPlayerSetStorageValue(cid, creature.creatureStorage, 0)
end
doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
getCreatureStorage = getPlayerStorageValue
doCreatureSetStorage = setPlayerStorageValue