Just tryed to add a Creature Kill Counter for my TFS 1.0 server.
Original Script:
http://otland.net/threads/creature-kill-count-system.177678/
CreatureScripts.xml
MonsterCounter.lua
and...
talkactions.xml
Monsters.lua
Error:
First had an error Before the last "else" but removed an "end", dunno if that was the right call.
Got Another error now...
What do I do now?
Kind Regards,
Eldin.
Original Script:
http://otland.net/threads/creature-kill-count-system.177678/
CreatureScripts.xml
Code:
<event type="kill" name="MonsterCounter" script="MonsterCounter.lua"/>
MonsterCounter.lua
Code:
function onKill(cid, target)
if (isCreature(target)) then
setPlayerStorageValue(cid, getCreatureByName(target) + 1)
end
return true
end
and...
talkactions.xml
Code:
<talkaction words="!monsters" script="monsters.lua"/>
and tryed with
<talkaction words="!monsters" separator=" " script="Monsters.lua"/>
Monsters.lua
Code:
function onSay(cid, words, param)
if (param == "") then
return false
end
t = string.explode(param, ",")
t[1] = monster
if (isCreature(monster)) then
if getPlayerStorageValue(monster) > 0 then
local amount = getPlayerStorageValue(param)
local text = "You have killed " .. amount .. " " .. param .."!"
doShowTextDialog(cid, 2175, text)
else
doPlayerSendCancel(cid, "You have not killed any of these monsters.")
return false
end
else
doPlayerSendCancel(cid, "You need to type a monster name.")
return false
end
end
Error:
First had an error Before the last "else" but removed an "end", dunno if that was the right call.
Got Another error now...
Code:
attempt to call field 'explode' <a nil value>
stack traceback: [C] etc...
What do I do now?
Kind Regards,
Eldin.