second = {enable = false, type = nil, values = {nil, nil}}
if tasks[s].rewards.second then
<script>
<event name="KillingInTheNameOf"/>
</script>
reward = {"exp", 1000, "teleport", {x=1000,y=1000,z=7}, "item", {2160,1}}
[12/01/2010 14:08:45] [Error - Npc interface]
[12/01/2010 14:08:45] data/npc/scripts/killinginthenameof.luanCreatureSay
[12/01/2010 14:08:45] Description:
[12/01/2010 14:08:45] attempt to index a nil value
[12/01/2010 14:08:45] stack traceback:
[12/01/2010 14:08:45] [C]: in function 'doTeleportThing'
[12/01/2010 14:08:45] data/npc/scripts/killinginthenameof.lua:118: in function 'callback'
[12/01/2010 14:08:45] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[12/01/2010 14:08:45] data/npc/scripts/killinginthenameof.lua:74: in function <data/npc/scripts/killinginthenameof.lua:74>
{enable = true, type = "boss", values = {x=703,y=600,z=7, false}},
Well, those arrays with information about task, rewards etc. can be shortened three times.
Why using disabled array:
while you can just check if it is:Code:second = {enable = false, type = nil, values = {nil, nil}}
Code:if tasks[s].rewards.second then
{enable = true, type = "boss", values = {x=703,y=600,z=7, false}},
{enable = true, type = "boss", values = {x=703,y=600,z=7}, false},
{enable = true, type = "boss", values = {x=703,y=600,z=7}, false},
[17/01/2010 10:58:49] [C]: in function 'doTeleportThing'
[17/01/2010 10:58:49] data/npc/scripts/killinginthenameof.lua:66: in function 'callback'
[17/01/2010 10:58:49] data/npc/lib/npcsystem/npchandler.lua:384: in function 'onCreatureSay'
[17/01/2010 10:58:49] data/npc/scripts/killinginthenameof.lua:22: in function <data/npc/scripts/killinginthenameof.lua:22>
For people who don't know much about lua, and don't know how to add rewars or something like that.
When i make a script, i think in people that are new in this, i try to write script with the minimun configuration.
If i write ascript and i write in my post (Example: "Configure rewards creating or deleting the rewards table, or disabling the rewards").. noobs can write something bad and get a error in console..if that happens, the my post will have so much replies about errors or something..
SORRY IF I WRITE IN BAD ENGLISH ;D!
@kudzu1988!
Change:
Lua:{enable = true, type = "boss", values = {x=703,y=600,z=7, false}},
To:
Lua:{enable = true, type = "boss", values = {x=703,y=600,z=7}, false},
The "false" need to be outside the position table, false in a second reward parameter.
@PEOPLE THAT SAYS "I KILL 100 TROLLS AND WHEN I SAY REPORT THE NPC STILL SAY THAT I HAVE KILLED 0 TROLLS"!!
YOU'RE DOING SOMETHING WRONG OR THE SCRIPT DON'T WORK WITH YOUR DISTRO... READ ALL MY POST AND FOLLOW ALL INTRUCTIONS, READ WELL THE PART ABOUT MONSTERS NAMES!
I have same problem when i chage code to:
Code:{enable = true, type = "boss", values = {x=703,y=600,z=7}, false},
from console:
Code:[17/01/2010 10:58:49] [C]: in function 'doTeleportThing' [17/01/2010 10:58:49] data/npc/scripts/killinginthenameof.lua:66: in function 'callback' [17/01/2010 10:58:49] data/npc/lib/npcsystem/npchandler.lua:384: in function 'onCreatureSay' [17/01/2010 10:58:49] data/npc/scripts/killinginthenameof.lua:22: in function <data/npc/scripts/killinginthenameof.lua:22>