mikkas70
Owner and Developer of omegaservers.org
- Joined
- Jan 6, 2009
- Messages
- 42
- Reaction score
- 8
Protocol: 8.6
As the title says, I'd like to know if there is any script that will be something like this:
1-Pull a lever that has a unique ID
2-An instant message will appear for everyone saying : "The battle has begun. Fight with honor and be the last man standing!"
If this helps, here it is my lever script:
Thanks!
As the title says, I'd like to know if there is any script that will be something like this:
1-Pull a lever that has a unique ID
2-An instant message will appear for everyone saying : "The battle has begun. Fight with honor and be the last man standing!"
If this helps, here it is my lever script:
local arenas = {
[7667] = {
fromPos ={
{x = 1005, y = 995, z = 10}, --player 1 start pos
{x = 1006, y = 995, z = 10}, --player 2 start pos
{x = 1007, y = 995, z = 10}, --player 3 start pos
{x = 1008, y = 995, z = 10}, --player 3 start pos
},
toPos = {
{x = 1008, y = 995, z = 10}, --player 1 teleport position
{x = 1009, y = 995, z = 10}, --player 2 teleport position
{x = 1010, y = 995, z = 10}, --player 3 teleport position
{x = 1011, y = 995, z = 10} --player 3 teleport position
}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 1946) then
doTransformItem(item.uid, 1945)
return TRUE
end
local arena = arenas[item.uid]
if(not arena) then
return FALSE
end
local players = {}
for _, pos in pairs(arena.fromPos) do
pos.stackpos = STACKPOS_TOP_CREATURE
local tmp = getThingfromPos(pos).uid
if(tmp > 0 and isCreature(tmp) == TRUE) then
table.insert(players, tmp)
end
end
if(table.maxn(players) < table.maxn(arena.fromPos)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need more creatures for duel.")
return TRUE
end
for i, pid in pairs(players) do
doSendMagicEffect(arena.fromPos, CONST_ME_POFF)
doTeleportThing(pid, arena.toPos)
doSendMagicEffect(arena.toPos, CONST_ME_TELEPORT)
doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "FIGHT!")
end
return TRUE
end
Thanks!