Ghazer
Member
- Joined
- Mar 13, 2009
- Messages
- 350
- Reaction score
- 6
I have this script
Thanks to Summ
I want add that to script
when teleport change position:
- - - Updated - - -
I creat that but teleport dont change position:
Thanks to Summ
LUA:
local towns = {1, 2, 3, 4, 5, 6}
local tp = {
id = 1387,
position = {x = 986, y = 1118, z = 6}
}
-- Do not change
local currentTown = 1
local function removeTp(pos, id)
local thing = getTileItemById(pos, id)
if thing.uid > 0 then
doRemoveItem(thing.uid)
end
end
function onThink(interval, lastExecution, thinkInterval)
local toPos = getTownTemplePosition(towns[currentTown])
currentTown = currentTown + 1
if not(towns[currentTown]) then
currentTown = 1
end
removeTp(tp.position, tp.id)
doCreateTeleport(tp.id, toPos, tp.position)
return true
end
I want add that to script
when teleport change position:
Code:
function onThink(interval, lastExecution, thinkInterval)
local temple = { x = 986, y = 1116, z = 6 }
doTeleportThing(cid, temple) [COLOR="#FF0000"]*TELEPORT TO LOCAL TEMPLE*[/COLOR]
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) [COLOR="#FF0000"]*EFFECT TELEPORT*[/COLOR]
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to the temple.") [COLOR="#FF0000"]*BROADCAST[/COLOR]*
doRemoveConditions(pid, true) [COLOR="#FF0000"]*Remove PZ*[/COLOR]
doCreatureAddHealth(pid, getCreatureMaxHealth(pid)) [COLOR="#FF0000"] *ADD MAX HEALTH*[/COLOR]
doCreatureAddMana(pid, getCreatureMaxMana(pid)) [COLOR="#FF0000"] *ADD MAX MANA*[/COLOR]
- - - Updated - - -
I creat that but teleport dont change position:
LUA:
local towns = {1, 2, 3, 4, 5, 6}
local tp = {
id = 1387,
position = {x = 986, y = 1118, z = 6}
}
-- Do not change
local currentTown = 1
local function removeTp(pos, id)
local thing = getTileItemById(pos, id)
if thing.uid > 0 then
doRemoveItem(thing.uid)
end
end
function onThink(interval, lastExecution, thinkInterval)
local toPos = getTownTemplePosition(towns[currentTown])
currentTown = currentTown + 1
if not(towns[currentTown]) then
currentTown = 1
end
removeTp(tp.position, tp.id)
doCreateTeleport(tp.id, toPos, tp.position)
return true
end
function onThink(interval, lastExecution)
for _, pid in ipairs(getPlayersOnline()) do
local temple = { x = 986, y = 1116, z = 6 }
doTeleportThing(pid, temple)
doRemoveConditions(pid)
doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
doCreatureAddMana(pid, getCreatureMaxMana(pid))
doBroadcastMessage("Map has been changed! Next map change will be in 25 minutes!", MESSAGE_STATUS_WARNING)
end
return true
end
Last edited: