Fabi Marzan
Member
- Joined
- Aug 31, 2020
- Messages
- 75
- Solutions
- 1
- Reaction score
- 18
Greetings as always again here with my problems.
I've been trying to figure out how to make it so that when a player uses the door, the other players will have to wait a certain time to use it again, another thing is how to make it so that if a player is in an area, the other players can't use the door... that comes out as "There is a player inside".
My idea is that when the player uses the door, a boss appears, so it is only for one player.
On the area to check if there is a player I have used the function:
But I don't know if it validates that function.
Here's an image for context:

This is the scripts that I'm putting together. If the player does not have the storage (91154), it cannot pass then when obtaining the storage (91154), when it tries again to open the door it passes to (91155), which is where you can't go back.
I know, my way of making scripts is very basic
I only need all the others, and it would be 100% scripts, which would be the boss, a room check so that no more players can enter,
a timer that only one player can enter and to use the door again they have to wait a certain time.
I would like that if the player does not kill the boss in 15min for example, he teleports and the boss disappears. I say this for troll people.
I've been trying to figure out how to make it so that when a player uses the door, the other players will have to wait a certain time to use it again, another thing is how to make it so that if a player is in an area, the other players can't use the door... that comes out as "There is a player inside".
My idea is that when the player uses the door, a boss appears, so it is only for one player.
On the area to check if there is a player I have used the function:
Lua:
local cfg = {
centrePosition = Position(1005, 1008, 6),
xRange = 5, -- smallest size you can use is 1. do not put 0, or it's range defaults to 12.
yRange = 5, -- (range 1 is an 'exori' 3 by 3 tiles. range 2 is 5 by 5 tiles)
multifloor = false, -- if you need to check all floors, not only Z floor from centrePosition
onlyPlayers = true,
}
local spectators = Game.getSpectators(cfg.centrePosition, cfg.multifloor, cfg.onlyPlayers, cfg.xRange, cfg.xRange, cfg.yRange, cfg.yRange)
for i = 1, #spectators do
local player = spectators[i]
if i == #spectators then
end
end
But I don't know if it validates that function.
Here's an image for context:

This is the scripts that I'm putting together. If the player does not have the storage (91154), it cannot pass then when obtaining the storage (91154), when it tries again to open the door it passes to (91155), which is where you can't go back.
Code:
local action = Action()
function action.onUse(cid, player, item, fromPosition, target, toPosition, isHotkey)
local player = Player(cid)
if not player then
return true
end
if getCreatureStorage(cid, 91155) == 1 then
player:getPosition():sendMagicEffect(3)
player:sendTextMessage(25, "There is no way back.") ------- PLAYER NOT BACK, So as not to spam (Storage - 91154)
return true
end
if getCreatureStorage(cid, 91154) == 1 then
player:getPosition():sendMagicEffect(11)
player:teleportTo(Position(10154, 10200, 7))
player:setDirection(DIRECTION_WEST)
player:sendTextMessage(25, "Be careful in 5 seconds the boss Drobura will appear...")
player:say("Be careful in 5 seconds the boss Drobura will appear...")
player:setStorageValue(91155, 1)
else
player:sendCancelMessage("You don't have the necessary items to pass. [Not Permission].")
return true
end
end
I know, my way of making scripts is very basic
I only need all the others, and it would be 100% scripts, which would be the boss, a room check so that no more players can enter,
a timer that only one player can enter and to use the door again they have to wait a certain time.
I would like that if the player does not kill the boss in 15min for example, he teleports and the boss disappears. I say this for troll people.