helviio
Member
- Joined
- Apr 30, 2019
- Messages
- 53
- Solutions
- 2
- Reaction score
- 12
Hello Otland People ... I come through this publication Ask for help to edit my script for [Boss Room] OTX2, TFS 0.X ... He does more or less what I want to be done ... as in this GIF he can enter alone or with more 1/2/3 players
However, he does not summon the monster. I would like you to summon I would also like to add a check if there is a player in the room making the boss so that other players cannot enter. only enter when the other players leave And the same player who made this boss cannot make the boss again for 12 hours and also add the following if the player enters alone. example boss, 1 player "Rat" // 2 players "Cave Rat" // 3 Players "Spider" // 4 Players "poison Spider" and after killing the Boss the monster drops the loot and opens a portal so that the player can leave ... and then immediately clean the room so that another player can enter ...
and set a time for him to kill the boss ... and if he doesn't, he'll be kicked out of the room so that other people can enter the room
My script is here, remembering that it is for OTX2, TFS 0.X
Lua:
local PosicionesDeLosJugadores = {
{ x = 32249, y = 31585, z = 7, stackpos = 253 }, -- ultimo sempre sem virgula
{ x = 32249, y = 31586, z = 7, stackpos = 253 },
{ x = 32249, y = 31587, z = 7, stackpos = 253 },
{ x = 32249, y = 31588, z = 7, stackpos = 253 }
}
local DestinoDeLosJugadores = {
{ x = 32250, y = 31600, z = 8 }, -- ultimo sempre sem virgula
{ x = 32250, y = 31600, z = 8 },
{ x = 32250, y = 31600, z = 8 },
{ x = 32250, y = 31600, z = 8 }
}
--# Cantidad minima de jugadores que pueden entrar.
local JugadoresMinimosParaEntrar = 1
local NivelMinimoRequerido = 1
--# Esta funcion solo se puede modificar si usara otro tipo de palanca.
local function onUseLever(item)
doTransformItem(item.uid, (item.itemid == 1945 and 1946 or 1945))
return true
end
--# Funcion principal, no necesitas editarla solo configurar las variables al comienzo del script!!!
function onUse(cid, item, fromPosition, target, toPosition)
local _errorLvl = 0
local GrupoDeJugadores = {}
local index = 1
local _errorInfo = ''
for _, position in pairs(PosicionesDeLosJugadores) do
local Jugador = getThingfromPos(position)
if isPlayer(Jugador.uid) then
if getPlayerLevel(Jugador.uid) >= NivelMinimoRequerido then
GrupoDeJugadores[index] = Jugador
index = index + 1
else
_errorLvl = _errorLvl + 1
end
end
end
if _errorLvl > 0 then
_errorInfo = ' (The minimum level is ' .. NivelMinimoRequerido .. ' and some players do not meet this requirement.)'
end
if ((index * 2) > (#PosicionesDeLosJugadores + #DestinoDeLosJugadores)) then
if getPlayerAccess(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'A symmetry error has been detected in the code, check the console for more details.')
end
print('ERROR: The variables do not comply with a correct symmetry.')
--!!! Solution: reparar las tablas de posiciones...
return false
end
if #GrupoDeJugadores == 0 then
doPlayerSendCancel(cid, 'There is no player in his starting position.' .. _errorInfo)
return onUseLever(item)
end
if #GrupoDeJugadores < JugadoresMinimosParaEntrar then
doPlayerSendCancel(cid, 'To start, there must be at least ' .. JugadoresMinimosParaEntrar .. ' players.' .. _errorInfo)
return onUseLever(item)
end
for _, Jugador in pairs(GrupoDeJugadores) do
doSendMagicEffect(getCreaturePosition(Jugador.uid), CONST_ME_POFF)
doTeleportThing(Jugador.uid, DestinoDeLosJugadores[_])
doSendMagicEffect(DestinoDeLosJugadores[_], CONST_ME_TELEPORT)
doPlayerSendCancel(cid, 'You are welcome!')
end
return onUseLever(item)
end
I appreciate the understanding of all of you I apologize for my English and I sincerely hope you can help me
Last edited: