michael
New Member
Hi I'm starting with lua scripting but I'm stuck now. I got a movementscript and when you walk over a tile there spam some monsters. when you move over the second tile the monsters disapear (this works) but when you walk about the first tile again I get a consolle error that it is inpossible to place the monsters.
But now I want to check if there are any monsters inside the room and you get a message that someone is still inside the room and the serv don't place any of the monsters.
I hope you understand what I mean.
Anyway here is my script
But now I want to check if there are any monsters inside the room and you get a message that someone is still inside the room and the serv don't place any of the monsters.
I hope you understand what I mean.
Anyway here is my script
Code:
function onStepIn(cid, item, pos)
local tijd = 10
local soortoutfit = {
lookType = 194,
lookHead = 114,
lookBody = 94,
lookLegs = 94,
lookFeet = 57,
lookAddons = 0
}
local monsterpos1 = {x=1136, y=704, z=7, stackpos=253}
local monsterpos2 = {x=1140, y=704, z=7, stackpos=253}
local monsterpos3 = {x=1136, y=701, z=7, stackpos=253}
local monsterpos4 = {x=1140, y=701, z=7, stackpos=253}
local monsterpos5 = {x=1136, y=698, z=7, stackpos=253}
local monsterpos6 = {x=1140, y=698, z=7, stackpos=253}
seconden = tijd*1000
local checkmonster1 = getThingfromPos(monsterpos1)
local checkmonster2 = getThingfromPos(monsterpos2)
local checkmonster3 = getThingfromPos(monsterpos3)
local checkmonster4 = getThingfromPos(monsterpos4)
local checkmonster5 = getThingfromPos(monsterpos5)
local checkmonster6 = getThingfromPos(monsterpos6)
local creature1 = getThingfromPos(monsterpos1)
local creature2 = getThingfromPos(monsterpos2)
local creature3 = getThingfromPos(monsterpos3)
local creature4 = getThingfromPos(monsterpos4)
local creature5 = getThingfromPos(monsterpos5)
local creature6 = getThingfromPos(monsterpos6)
if item.actionid == 1036 and isPlayer(cid) == 1 then
doSummonCreature("Adept of the Cult", monsterpos1)
doSummonCreature("Adept of the Cult", monsterpos2)
doSummonCreature("Adept of the Cult", monsterpos3)
doSummonCreature("Adept of the Cult", monsterpos4)
doSummonCreature("Adept of the Cult", monsterpos5)
doSummonCreature("Adept of the Cult", monsterpos6)
doSetCreatureOutfit(cid, soortoutfit, seconden)
doTransformItem(item.uid, 425)
elseif isPlayer(cid) == -1 then
return 0
end
if item.actionid == 1037 and isPlayer(cid) == 1 then
doRemoveCreature(creature1.uid)
doRemoveCreature(creature2.uid)
doRemoveCreature(creature3.uid)
doRemoveCreature(creature4.uid)
doRemoveCreature(creature5.uid)
doRemoveCreature(creature6.uid)
doTransformItem(item.uid, 425)
end
end
function onStepOut(cid, item, pos)
if item.actionid == 1036 then
doTransformItem(item.uid, 426)
end
if item.actionid == 1037 then
doTransformItem(item.uid, 426)
end
end