Mr Erimyth
Member
VERSION : OTX Custon 1.3
Hell0o Anyone Can Help me ? my script dont teleports Players to new Roon
I need script if have 10 Players in 10 position and one use lever teleport all to new positions, all members need 100 Demonic essence and 30 Comandos Tokens
if one player dont have itens, no teleport anything.
my script dont have error on console ...
Hell0o Anyone Can Help me ? my script dont teleports Players to new Roon
I need script if have 10 Players in 10 position and one use lever teleport all to new positions, all members need 100 Demonic essence and 30 Comandos Tokens
if one player dont have itens, no teleport anything.
my script dont have error on console ...
Lua:
-- Ao clicar na alavanca teleport 10 players para as 10 posicoes
--Pos atual
local playerPosition = {
{x = 27137, y = 29737, z = 8,}, -- Trono 1
{x = 27224, y = 29693, z = 9,}, -- Trono 2
{x = 27154, y = 29638, z = 9,}, -- Trono 3
{x = 27212, y = 29785, z = 5,}, -- Trono 10
{x = 27121, y = 29710, z = 2,}, -- Trono 9
{x = 27061, y = 29753, z = 6,}, -- Trono 8
{x = 27016, y = 29786, z = 7,}, -- Trono 7
{x = 27059, y = 29772, z = 8,}, -- Trono 6
{x = 27013, y = 29670, z = 7,}, -- Trono 4
{x = 27044, y = 29727, z = 7,} -- Trono Principal 5 (Com alavanca)
}
--nova pos
local newPosition = {
{x = 27017, y = 29692, z = 8},
{x = 27018, y = 29692, z = 8},
{x = 27019, y = 29692, z = 8},
{x = 27020, y = 29692, z = 8},
{x = 27021, y = 29692, z = 8},
{x = 27022, y = 29692, z = 8},
{x = 27023, y = 29692, z = 8},
{x = 27024, y = 29692, z = 8},
{x = 27025, y = 29692, z = 8},
{x = 27026, y = 29692, z = 8}
}
local qtdPlayersToQuest = 1 -- test purpose
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = {}
local haveAllRequiredActions = false
if item.itemid == 1945 then
for i = 1, qtdPlayersToQuest do
player[i] = getThingfromPos(playerPosition[i])
if isPlayer(player[i].uid) ~= TRUE or getPlayerItemCount(player[i].uid, 6500) < 100 or getPlayerItemCount(player[i].uid, 29070) < 30 then
doCreatureSay(cid, 'You must conquest all Spirits Temples and each one needs to sacrifice 100 demoniac essence and 30 Comandos Tokens enter on Spirits of Infernia (SOI).', TALKTYPE_ORANGE_1)
return false
end
if getPlayerLevel(player[i].uid) < 1000 then
doCreatureSay(cid, 'This quest can only be made by players level ' .. tostring(getConfigValue("soiLevel")) .. '+', TALKTYPE_ORANGE_1)
return false
end
end
for i = 1, qtdPlayersToQuest do
player[i] = getThingfromPos(playerPosition[i])
doPlayerRemoveItem(player[i].uid,6500, 100)
doPlayerRemoveItem(player[i].uid,29070, 30)
doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
doTeleportThing(player[i].uid, newPosition[i], FALSE)
doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
end
return true
elseif item.itemid == 1946 then
doPlayerSendCancel(cid, "Sorry, not possible. You need 10 players, one on each throne with the soul of the demonic.")
return doTransformItem(item.uid, item.itemid - 1)
end
end