I do not make many scripts so i was wondering why this wasn't working. I am using TFS 8.7 Mystic Spirit.
This is the error i got.
I wanted the script to have a random chance to spawn a mob at a few different locations when someone walks onto a tile with the action id of 6500.
Code:
function onStepIn(cid, item, frompos, item2, topos)
local dice = math.random(1, 5000)
local tile1 = {x=1090, y=744, z=7}
local tile2 = {x=1090, y=744, z=7}
local tile3 = {x=1090, y=744, z=7}
local tile4 = {x=1090, y=744, z=7}
local tile5 = {x=1090, y=744, z=7}
local tile6 = {x=1091, y=744, z=7}
if item.actionid == 6500 and dice == 1 then
doSummonCreature(rotworm, tile1)
else if item.actionid == 6500 and dice == 3 then
doSummonCreature(rotworm, tile2)
else if item.actionid == 6500 and dice == 7 then
doSummonCreature(rotworm, tile3)
else if item.actionid == 6500 and dice == 9 then
doSummonCreature(rotworm, tile4)
else if item.actionid == 6500 and dice == 9 then
doSummonCreature(rotworm, tile5)
else if item.actionid == 6500 and dice > 1 then
doSummonCreature(rotworm, tile6)
end
end
end
end
end
end
return TRUE
end
This is the error i got.
Code:
[27/04/2011 20:23:45] Lua Script Error: [MoveEvents Interface]
[27/04/2011 20:23:45] data/movements/scripts/rare spawns.lua:onStepIn
[27/04/2011 20:23:45] luaDoSummonCreature(). Monster name() not found
[27/04/2011 20:23:45] stack traceback:
[27/04/2011 20:23:45] [C]: in function 'doSummonCreature'
[27/04/2011 20:23:45] data/movements/scripts/rare spawns.lua:21: in function <data/movements/scripts/rare spawns.lua:1>
I wanted the script to have a random chance to spawn a mob at a few different locations when someone walks onto a tile with the action id of 6500.