Hello. I got this script, but its not working properly.
When i kill the monster "dragonator" i should get teleported to the "newPosition".
But its not working, i do not get teleported, and there's no errors in console.
Please help.
creaturescript.lua
movements.lua
Please help me out.
When i kill the monster "dragonator" i should get teleported to the "newPosition".
But its not working, i do not get teleported, and there's no errors in console.
Please help.
creaturescript.lua
Code:
local a = {
newPos = {x=1497, y=819, z=7}, ---new pos after kill boss
msg = "You defeted the Dragonator and may choose a reward.",
area = {
fromX = 1463, toX = 846,
fromY = 1473, toY = 856,
z = 7
}
}
function onKill(cid, target, damage, flags)
local name = getCreatureName(target):lower()
if name == 'dragonator' then
local players = getCreaturesInRange({x=1468, y=851,z=7}, 10, 9, FALSE, TRUE) --- pos range monster
for i = 1, #players do
doTeleportThing(players[i], a.newPos)
doCreatureSay(players[i], a.msg, TALKTYPE_ORANGE_1, false, players[i], getCreaturePosition(players[i]))
end
local name = getCreatureName(target):lower()
if name == 'dragonator' then
setPlayerStorageValue(cid,7778,1)
setGlobalStorageValue(7779, -1)
end
end
return true
end
movements.lua
Code:
local pos = {x=1468, y=853, z=7} --- Position monster summon
local spawn = {x=1466, y=850, z=7} --- Spawn position
function onStepIn(cid, item, position, fromPosition)
local newPosition = {x=1468, y=847, z=7} --- new position
local noPosition = {x=1469, y=858, z=8} --- no position
if(getGlobalStorageValue(7778) < 1) and (getPlayerStorageValue(cid, 7778) == -1) then
doTeleportThing(cid, newPosition, TRUE)
doSummonCreature('Dragonator', spawn)
doPlayerSendTextMessage(cid,18,'You need to kill the boss.')
setGlobalStorageValue(7779, 1)
else
doTeleportThing(cid, noPosition, TRUE)
doPlayerSendTextMessage(cid,18,'You have already done this quest.')
end
return true
end
Please help me out.
Last edited by a moderator: