i updated to the beta version recently. b4 i was using a script that was summoning some monster around the person who "liberated" the monster. now i got 2 errors :blink:.
1-when i open the server i get "luaGetCreaturePosition(). Creature not found".
2-when the script is activated i get "luaDoSummonCReature(). Can not summon monster : ~monster name~"
and here is my code.
tks
1-when i open the server i get "luaGetCreaturePosition(). Creature not found".
2-when the script is activated i get "luaDoSummonCReature(). Can not summon monster : ~monster name~"
and here is my code.
Code:
local function summon(parameters)
pos = {parameters.frompos.x+1, parameters.frompos.y, parameters.frompos.z}
doPlayerSendCancel(parameters.cid, pos)
doSummonCreature(parameters.name, parameters.frompos)
return 1
end
pos = getPlayerPosition(cid)
function onUse(cid, item, frompos, item2, topos)
random = math.random(1,2)
if item.itemid == 5957 and item.actionid == 0 then
if random == 1 then
doRemoveItem(item.uid,1)
doSendAnimatedText(getPlayerPosition(cid), "Empty! :(", 3)
doSendMagicEffect(getPlayerPosition(cid),0)
elseif random == 2 then
doRemoveItem(item.uid,1)
doSendAnimatedText(getPlayerPosition(cid), "Hummmm...", 1)
doSendMagicEffect(getPlayerPosition(cid),0)
random2 = math.random(1,2)
if random2 == 1 then
name = "Guard"
elseif random2 == 2 then
name = "Warrior"
end
local parameters = {cid=cid, name=name, frompos=frompos}
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "The scroll was trapped! A " ..name.. " will be summoned!!!")
addEvent(summon, 2500, parameters)
end
tks