local timed = 120 -- Seconds
local monsters =
{
----- Teleport Position ---------- New Player Position -----
["Thalas"] = {x=3374, y=3337, z=14, stackpos=1}, {x=3374, y=3359], z=15},
["Rahemos"] = {x=3356, y=3567, z=15, stackpos=1}, {x=3381, y=3574, z=15},
["Mahrdis"] = {x=3241, y=3509, z=15, stackpos=1}, {x=3220, y=3512, z=15},
["Omruc"] = {x=3468, y=3450, z=15, stackpos=1}, {x=3494, y=3453, z=15}
}
function onKill(cid, target, lastHit)
for name, pos in pairs(monsters) do
if name == getCreatureName(target) then
doCreateTeleport(1387, pos[1], pos[2])
doCreatureSay(target, "You have ".. timed .." seconds before the portal closes!", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, timed * 1000)
end
end
local function removeTeleport()
local teleport = getTileItemById(pos[1], 1387)
if teleport.uid > 0 then
doRemoveItem(teleport.uid)
end
end
[20/08/2009 00:54:13]
[20/08/2009 00:54:13] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/ultimate.lua)
[20/08/2009 00:54:13] data/creaturescripts/scripts/ultimate.lua:5: '}' expected near ']'
local timed = 120 -- Seconds
local monsters =
{
----- Teleport Position ---------- New Player Position -----
["Thalas"] = {(x=3374, y=3337, z=14, stackpos=1), (x=3374, y=3359, z=15)},
["Rahemos"] = {(x=3356, y=3567, z=15, stackpos=1), (x=3381, y=3574, z=15)},
["Mahrdis"] = {(x=3241, y=3509, z=15, stackpos=1), (x=3220, y=3512, z=15)},
["Omruc"] = {(x=3468, y=3450, z=15, stackpos=1), (x=3494, y=3453, z=15)}
}
local function removeTeleport()
local teleport = getTileItemById(pos[1], 1387)
if teleport.uid > 0 then
doRemoveItem(teleport.uid)
end
end
function onKill(cid, target, lastHit)
for name, pos in pairs(monsters) do
if name == getCreatureName(target) then
doCreateTeleport(1387, pos[1], pos[2])
doCreatureSay(target, "You have ".. timed .." seconds before the portal closes!", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, timed * 1000)
end
end
richux...
Lua:local timed = 120 -- Seconds local monsters = { ----- Teleport Position ---------- New Player Position ----- ["Thalas"] = {(x=3374, y=3337, z=14, stackpos=1), (x=3374, y=3359, z=15)}, ["Rahemos"] = {(x=3356, y=3567, z=15, stackpos=1), (x=3381, y=3574, z=15)}, ["Mahrdis"] = {(x=3241, y=3509, z=15, stackpos=1), (x=3220, y=3512, z=15)}, ["Omruc"] = {(x=3468, y=3450, z=15, stackpos=1), (x=3494, y=3453, z=15)} } local function removeTeleport() local teleport = getTileItemById(pos[1], 1387) if teleport.uid > 0 then doRemoveItem(teleport.uid) end end function onKill(cid, target, lastHit) for name, pos in pairs(monsters) do if name == getCreatureName(target) then doCreateTeleport(1387, pos[1], pos[2]) doCreatureSay(target, "You have ".. timed .." seconds before the portal closes!", TALKTYPE_ORANGE_1) addEvent(removeTeleport, timed * 1000) end end
[20/08/2009 11:07:21] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/ultimate.lua)
[20/08/2009 11:07:21] data/creaturescripts/scripts/ultimate.lua:5: ')' expected near '='
local timed = 120 -- Seconds
local monsters =
{
----- Teleport Position ---------- New Player Position -----
["Thalas"] = { { x = 3374, y = 3337, z = 14, stackpos = 1}, { x = 3374, y = 3359, z = 15 } },
["Rahemos"] = { { x = 3356, y = 3567, z = 15, stackpos = 1}, { x = 3381, y = 3574, z = 15 } },
["Mahrdis"] = { { x = 3241, y = 3509, z = 15, stackpos = 1}, { x = 3220, y = 3512, z = 15 } },
["Omruc"] = { { x = 3468, y = 3450, z = 15, stackpos = 1}, { x = 3494, y = 3453, z = 15 } }
}
local function removeTeleport()
local teleport = getTileItemById(pos[1], 1387)
if teleport.uid > 0 then
doRemoveItem(teleport.uid)
end
end
function onKill(cid, target, lastHit)
for name, pos in pairs(monsters) do
if name == string.lower(getCreatureName(target)) then
doCreateTeleport(1387, pos[1], pos[2])
doCreatureSay(target, "You have ".. timed .." seconds before the portal closes!", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, timed * 1000)
end
end
local timed = 120 -- Seconds
local monsters =
{
----- Teleport Position ---------- New Player Position -----
["Thalas"] = { { x = 3374, y = 3337, z = 14, stackpos = 1}, { x = 3374, y = 3359, z = 15 } },
["Rahemos"] = { { x = 3356, y = 3567, z = 15, stackpos = 1}, { x = 3381, y = 3574, z = 15 } },
["Mahrdis"] = { { x = 3241, y = 3509, z = 15, stackpos = 1}, { x = 3220, y = 3512, z = 15 } },
["Omruc"] = { { x = 3468, y = 3450, z = 15, stackpos = 1}, { x = 3494, y = 3453, z = 15 } }
}
local function removeTeleport()
local teleport = getTileItemById(pos[1], 1387)
if teleport.uid > 0 then
doRemoveItem(teleport.uid)
end
return TRUE
end
function onKill(cid, target, lastHit)
for name, pos in pairs(monsters) do
if name:lower() == string.lower(getCreatureName(target)) then
doCreateTeleport(1387, pos[1], pos[2])
doCreatureSay(target, "You have ".. timed .." seconds before the portal closes!", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, timed * 1000)
end
end
return TRUE
end
if name == string.lower(getCreatureName(target)) then
if "Omruc" == "omruc" then
<event type="kill" name="monsterPortals" event="script" value="script.lua"/>
<event type="kill" name="monsterPortals" script="script.lua"/>
Shouldn't it be like this in creaturescripts.xml?
PHP:<event type="kill" name="monsterPortals" event="script" value="script.lua"/>
instead of?PHP:<event type="kill" name="monsterPortals" script="script.lua"/>
event="script" value="script.lua instead of
script="script.lua"
i might be wrong :O
local timed = 120 -- Seconds
local monsters =
{
----- Teleport Position ---------- New Player Position -----
["Thalas"] = {{x=3374, y=3337, z=14, stackpos=1}, {x=3374, y=3359, z=15}},
["Rahemos"] = {{x=3356, y=3567, z=15, stackpos=1}, {x=3381, y=3574, z=15}},
["Mahrdis"] = {{x=3241, y=3509, z=15, stackpos=1}, {x=3220, y=3512, z=15}},
["Omruc"] = {{x=3468, y=3450, z=15, stackpos=1}, {x=3494, y=3453, z=15}}
}
local function removeTeleport()
local teleport = getTileItemById(pos[1], 1387)
if teleport.uid > 0 then
doRemoveItem(teleport.uid)
end
end
function onKill(cid, target, lastHit)
for name, pos in pairs(monsters) do
if name == getCreatureName(target) then
doCreateTeleport(1387, pos[1], pos[2])
doCreatureSay(target, "You have ".. timed .." seconds before the portal closes!", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, timed * 1000)
end
end
return TRUE
end
Script Updated.