Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
If a player is on playerPositions, then next player that tries to enter gets message & teleportTo(fromPosition).
As of right now, nobody can enter the room, even if playerPos is nil.
solution:
As of right now, nobody can enter the room, even if playerPos is nil.
Code:
local playerPositions = Position(603, 975, 15)
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end
if playerPositions == nil then
return false
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "This table is full.")
player:teleportTo(fromPosition, false)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end
end
solution:
Code:
local playerPositions = Position(1002, 935, 10)
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end
local specs, spec = Game.getSpectators(playerPositions, false, false, 1, 1, 1, 1)
for i = 1, #specs do
spec = specs[i]
if spec:isPlayer() then
player:teleportTo(fromPosition, false)
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You Shall Not Pass.")
return true
end
end
end
Last edited: