• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Need a fix] (internalGetPlayerInfo) Player not found when requesting player info #1

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
Hello,
I'm my console is spamming an error with this script

Description:
(internalGetPlayerInfo) Player not found when requesting player info #1

Lua:
function onStepIn(cid, item, position, fromPosition)
 
if (not isPlayer(cid)) then
	return true
end

--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 337, y = 849, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
	doTeleportThing(cid, player_pos_saida)
	doSendMagicEffect(player_pos_saida, 10)
	doRemoveItem(portal_iten_pos.uid, 1)
	return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
	players = 0
	totalmonsters = 0
	monster = {}
	repeat
	creature = getThingfromPos(checking)
	if creature.itemid > 0 then
 
		if getPlayerAccess(creature.uid) == 0 then
			players = players + 1
		end
 
		if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
			totalmonsters = totalmonsters + 1
			monster[totalmonsters] = creature.uid
		end
	end
		checking.x = checking.x + 1
 
	if checking.x > ending.x then
		checking.x = starting.x
		checking.y = checking.y + 1
	end
 
	until checking.y > ending.y
 
	if players == 0 then
 
		if totalmonsters ~= 0 then
			current = 0
			repeat
			current = current + 1
			doRemoveCreature(monster[current])
			until current >= totalmonsters
		end
 
		doTeleportThing(cid, player_pos_entrada)
		doSendMagicEffect(player_pos_entrada, 10)
		doCreateMonster(boss, boss_pos)
 
		if portal_iten_pos.itemid == teleportId then
			doRemoveItem(portal_iten_pos.uid, 1)
		end
 
	else
		doMoveCreature(cid, newdir)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '" .. getCreatureName(cid) .." is in the room now. Wait a moment!')
	end
else
	doMoveCreature(cid, newdir)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end
 
Last edited:
Code:
[Error - Movements Interface] 
data/movements/scripts/Firewalker/the_pythius__rotten_portal.lua:onStepIn
Description:
(internalGetPlayerInfo) Player not found when requesting player info #1

It appears 3x when monster got removed(and created another one).

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
 
if (not isPlayer(cid)) then
	return true
end
 
--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 337, y = 849, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
	doTeleportThing(cid, player_pos_saida)
	doSendMagicEffect(player_pos_saida, 10)
	doRemoveItem(portal_iten_pos.uid, 1)
	return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
	players = 0
	totalmonsters = 0
	monster = {}
	repeat
	creature = getThingfromPos(checking)
	if creature.itemid > 0 then
 
		if getPlayerAccess(creature.uid) == 0 then
			players = players + 1
		end
 
		if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
			totalmonsters = totalmonsters + 1
			monster[totalmonsters] = creature.uid
		end
	end
		checking.x = checking.x + 1
 
	if checking.x > ending.x then
		checking.x = starting.x
		checking.y = checking.y + 1
	end
 
	until checking.y > ending.y
 
	if players == 0 then
 
		if totalmonsters ~= 0 then
			current = 0
			repeat
			current = current + 1
			doRemoveCreature(monster[current])
			until current >= totalmonsters
		end
 
		doTeleportThing(cid, player_pos_entrada)
		doSendMagicEffect(player_pos_entrada, 10)
		doCreateMonster(boss, boss_pos)
 
		if portal_iten_pos.itemid == teleportId then
			doRemoveItem(portal_iten_pos.uid, 1)
		end
 
	else
		doMoveCreature(cid, newdir)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '" .. getCreatureName(cid) .." is in the room now. Wait a moment!')
	end
else
	doMoveCreature(cid, newdir)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end
 
try this

Lua:
function onStepIn(cid, item, frompos, itemEx, topos)
 
if (not isPlayer(cid)) then
	return true
end
 
--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 337, y = 849, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
	doTeleportThing(cid, player_pos_saida)
	doSendMagicEffect(player_pos_saida, 10)
	doRemoveItem(portal_iten_pos.uid, 1)
	return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
	players = 0
	totalmonsters = 0
	monster = {}
	repeat
	creature = getThingfromPos(checking)
	if creature.itemid > 0 then
 
		if getPlayerAccess(creature.uid) == 0 then
			players = players + 1
		end
 
		if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
			totalmonsters = totalmonsters + 1
			monster[totalmonsters] = creature.uid
		end
	end
		checking.x = checking.x + 1
 
	if checking.x > ending.x then
		checking.x = starting.x
		checking.y = checking.y + 1
	end
 
	until checking.y > ending.y
 
	if players == 0 then
 
		if totalmonsters ~= 0 then
			current = 0
			repeat
			current = current + 1
			doRemoveCreature(monster[current])
			until current >= totalmonsters
		end
 
		doTeleportThing(cid, player_pos_entrada)
		doSendMagicEffect(player_pos_entrada, 10)
		doCreateMonster(boss, boss_pos)
 
		if portal_iten_pos.itemid == teleportId then
			doRemoveItem(portal_iten_pos.uid, 1)
		end
 
	else
		doMoveCreature(cid, newdir)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '" .. getCreatureName(cid) .." is in the room now. Wait a moment!')
	end
else
	doMoveCreature(cid, newdir)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
return TRUE
end
 
Spamming
[Error - Movements Interface]
data/movements/scripts/Firewalker/the_pythius__rotten_portal.lua:eek:nStepIn
Description:
(internalGetPlayerInfo) Player not found when requesting player info #1
 
Portal that teleports player to Firewalker Boots Boss room

1. Only 1 player per time.
2. If have XXXX storage can't enter.
3. If playerA die and moster still alive then if PlayerB enter oldMonster(deleted) and newMonster(created).
 
Try this:
Lua:
function onStepIn(cid, item, position, fromPosition)
 
if (not isPlayer(cid)) then
	return true
end
 
--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 337, y = 849, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
	doTeleportThing(cid, player_pos_saida)
	doSendMagicEffect(player_pos_saida, 10)
	doRemoveItem(portal_iten_pos.uid, 1)
	return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
	players = 0
	totalmonsters = 0
	monster = {}
	repeat
	creature = getThingfromPos(checking)
	if creature.itemid > 0 then
 
		if getPlayerAccess(creature.uid) == 0 then
			players = players + 1
		end
 
		if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
			totalmonsters = totalmonsters + 1
			monster[totalmonsters] = creature.uid
		end
	end
		checking.x = checking.x + 1
 
	if checking.x > ending.x then
		checking.x = starting.x
		checking.y = checking.y + 1
	end
 
	until checking.y > ending.y
 
	if players == 0 then
 
		if totalmonsters ~= 0 then
			current = 0
			repeat
			current = current + 1
			doRemoveCreature(monster[current])
			until current >= totalmonsters
		end
 
		doTeleportThing(cid, player_pos_entrada)
		doSendMagicEffect(player_pos_entrada, 10)
		doCreateMonster(boss, boss_pos)
 
		if portal_iten_pos.itemid == teleportId then
			doRemoveItem(portal_iten_pos.uid, 1)
		end
 
	else
		doMoveCreature(cid, newdir)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "" .. getCreatureName(cid) .." is in the room now. Wait a moment!")
	end
else
	doMoveCreature(cid, newdir)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end

@Rateser:
Why are you trying to know if it is door/portal?
You can always do:
Lua:
if(players > 0) then
doTeleportThing(cid, fromPosition)
end
if it is a portal.
Lua:
if(players > 0) then
return false
end
if it is a door.
 
Try this:
Lua:
function onStepIn(cid, item, position, fromPosition)
 
if (not isPlayer(cid)) then
	return true
end
 
--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 337, y = 849, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
	doTeleportThing(cid, player_pos_saida)
	doSendMagicEffect(player_pos_saida, 10)
	doRemoveItem(portal_iten_pos.uid, 1)
	return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
	players = 0
	totalmonsters = 0
	monster = {}
	repeat
	creature = getThingfromPos(checking)
	if creature.itemid > 0 then
 
		if getPlayerAccess(creature.uid) == 0 then
			players = players + 1
		end
 
		if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
			totalmonsters = totalmonsters + 1
			monster[totalmonsters] = creature.uid
		end
	end
		checking.x = checking.x + 1
 
	if checking.x > ending.x then
		checking.x = starting.x
		checking.y = checking.y + 1
	end
 
	until checking.y > ending.y
 
	if players == 0 then
 
		if totalmonsters ~= 0 then
			current = 0
			repeat
			current = current + 1
			doRemoveCreature(monster[current])
			until current >= totalmonsters
		end
 
		doTeleportThing(cid, player_pos_entrada)
		doSendMagicEffect(player_pos_entrada, 10)
		doCreateMonster(boss, boss_pos)
 
		if portal_iten_pos.itemid == teleportId then
			doRemoveItem(portal_iten_pos.uid, 1)
		end
 
	else
		doMoveCreature(cid, newdir)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "" .. getCreatureName(cid) .." is in the room now. Wait a moment!")
	end
else
	doMoveCreature(cid, newdir)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end

@Rateser:
Why are you trying to know if it is door/portal?
You can always do:
Lua:
if(player > 0) then
doTeleportThing(cid, fromPosition)
end
if it is a portal.
Lua:
if(player > 0) then
return false
end
if it is a door.

When monster is removed then it show in console 3x
Lua:
[Error - Movements Interface] 
data/movements/scripts/Firewalker/the_pythius__rotten_portal.lua:onStepIn
Description:
(internalGetPlayerInfo) Player not found when requesting player info #1
 
I could try to script this but I just want more info and I want to know what the "local"s are saying for example:
Lua:
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
I want to know what all locals are.

Is there any other monsters in the room, or just the boss?
 
Lua:
local starting = {x = 321, y = 829, z = 15, stackpos = 253} --NW of room
local ending = {x = 337, y = 849, z = 15, stackpos = 253} --SE of room
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1} --Where newportal will be created when monster dies(creatureeventscript) IGNORE IT
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387 --Teleport ID
local player_pos_entrada = {x = 326, y = 840, z = 15} --New pos when stepin TP.(inside the room)
local player_pos_saida = {x = 842, y = 839, z = 15} --local portal_in_pos where it will bring(ignore too, its creatureevent)
local boss_pos = {x = 333, y = 837, z = 15} --where boss will be created
local boss = "Pythius The Rotten" --monster name
local queststatus = getPlayerStorageValue(cid, 9933) --If player have this storage then he cant stepin.

This room is empty, no monsters. The script create the boss.
The boss can summon 2 undead gladiator
 
Last edited:
Phew...
pythiustherotten.lua:
Lua:
local isPlayerInArea, isMonsterInArea = 0, 0
local monsterId = {}
local monsterName = {"Pythius The Rotten"}
local storageKey = 9935
local monsterPos = {
	x = 333,
	y = 837,
	z = 15
}
local newPos = {
	x = 326,
	y = 840,
	z = 15
}
local areaPos = {
	z = 15,
	fromPos = {
		x = 320,
		y = 828
	},
	toPos = {
		x = 345,
		y = 847
	}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(getCreatureStorage(cid, storageKey) > 0) then
		for xPosition = areaPos.fromPos.x, areaPos.toPos.x do
			for yPosition = areaPos.fromPos.y, areaPos.toPos.y do
				local pos = {x = xPosition, y = yPosition, z = areaPos.z, stackpos = STACKPOS_TOP_CREATURE}
				local pid = getThingfromPos(pos).uid
				if(isPlayer(pid) == 1) then
					isPlayerInArea = 1
					break
				elseif(isMonster(pid) == 1 and isInArray(monsterName, getCreatureName(pid))) then
					table.insert(monsterId, pid)
					isMonsterInArea = 1
				end
			end
		end
		
		if(isPlayerInArea == 1 or (isPlayerInArea == 1 and isMonsterInArea == 1)) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You sense a mighty force coming from the portal. Better wait until it fades off.")
			doTeleportThing(cid, lastPosition)
		elseif(isMonsterInArea == 1) then
			doRemoveCreature(monsterId)
			doTeleportThing(cid, newPos)
			doCreateMonster(monsterName, monsterPos)
		end

		monsterId = {}
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "The energy coming from the portal does not lets you pass through.")
		doTeleportThing(cid, lastPosition)
	end

	return true
end
 
Last edited:
Lua:
local isPlayerInArea, isMonsterInArea = 0, 0
local monsterId = {}
local monsterName = {"Pythius The Rotten"}
local storageKey = 9935
local monsterPos = {
	x = 333,
	y = 837,
	z = 15
}
local newPos = {
	x = 326,
	y = 840,
	z = 15
}
local areaPos = {
	z = 15,
	fromPos = {
		x = 320,
		y = 828
	},
	toPos = {
		x = 345,
		y = 847
	}
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(getCreatureStorage(cid, storageKey) > 0) then
		for xPosition = areaPos.fromPos.x, areaPos.toPos.x do
			for yPosition = areaPos.fromPos.y, areaPos.toPos.y do
				local pos = {x = xPosition, y = yPosition, z = areaPos.z, stackpos = STACKPOS_TOP_CREATURE}
				local pid = getThingfromPos(pos).uid
				if(isPlayer(pid) == 1) then
					isPlayerInArea = 1
					break
				elseif(isMonster(pid) == 1 and isInArray(monsterName, getCreatureName(pid))) then
					table.insert(monsterId, pid)
					isMonsterInArea = 1
				end
			end
		end
 
		if(isPlayerInArea == 1 or (isPlayerInArea == 1 and isMonsterInArea == 1)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Someone is in the room now. Wait a moment!")
			doTeleportThing(cid, lastPosition)
		elseif(isMonsterInArea == 1) then
			doRemoveCreature(monsterId)
			doTeleportThing(cid, newPos)
			doCreateMonster(monsterName, monsterPos)
		end
	end
 
	monsterId = {}
	return true
end

When player stepin nothing happens, no teleport and no errors.
 
My bad...9933 it'll be then.
Lua:
local isPlayerInArea, isMonsterInArea = 0, 0
local playerId, monsterId = nil, nil
local monsterName = {"Pythius The Rotten"}
local storageKey = 9933
local monsterPos = {
	x = 333,
	y = 837,
	z = 15
}
local newPos = {
	x = 326,
	y = 840,
	z = 15
}
local areaPos = {
	z = 15,
	fromPos = {
		x = 320,
		y = 828
	},
	toPos = {
		x = 345,
		y = 847
	}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(getCreatureStorage(cid, storageKey) < 0) then
		for xPosition = areaPos.fromPos.x, areaPos.toPos.x do
			for yPosition = areaPos.fromPos.y, areaPos.toPos.y do
				local pos = {x = xPosition, y = yPosition, z = areaPos.z, stackpos = STACKPOS_TOP_CREATURE}
				local pid = getThingfromPos(pos).uid
				if(isPlayer(pid) == 1) then
					playerId = pid
					isPlayerInArea = 1
					break
				elseif(isMonster(pid) == 1 and isInArray(monsterName, getCreatureName(pid))) then
					monsterId = pid
					isMonsterInArea = 1
				end
			end
		end

		if(isPlayerInArea == 1 or (isPlayerInArea == 1 and isMonsterInArea == 1)) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "" .. getCreatureName(playerId) .. " is in the room now. Wait a moment!")
			doTeleportThing(cid, lastPosition)
		elseif(isMonsterInArea == 1) then
			doRemoveCreature(monsterId)
			doTeleportThing(cid, newPos)
			doCreateMonster(monsterName, monsterPos)
		end

		playerId, monsterId = nil, nil
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sorry you already did this quest!")
		doTeleportThing(cid, lastPosition)
	end

	return true
end

Fixed too...damn symbols.
 
Last edited:
If player have storage 9933 then he can't get in.

PS.: It's not working, just "The energy coming from the portal does not lets you pass through."

Lua:
local isPlayerInArea, isMonsterInArea = 0, 0
local monsterId = {}
local monsterName = {"Pythius The Rotten"}
local storageKey = 9933
local monsterPos = {
	x = 333,
	y = 837,
	z = 15
}
local newPos = {
	x = 326,
	y = 840,
	z = 15
}
local areaPos = {
	z = 15,
	fromPos = {
		x = 320,
		y = 828
	},
	toPos = {
		x = 345,
		y = 847
	}
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(getCreatureStorage(cid, storageKey) > 0) then
		for xPosition = areaPos.fromPos.x, areaPos.toPos.x do
			for yPosition = areaPos.fromPos.y, areaPos.toPos.y do
				local pos = {x = xPosition, y = yPosition, z = areaPos.z, stackpos = STACKPOS_TOP_CREATURE}
				local pid = getThingfromPos(pos).uid
				if(isPlayer(pid) == 1) then
					isPlayerInArea = 1
					break
				elseif(isMonster(pid) == 1 and isInArray(monsterName, getCreatureName(pid))) then
					table.insert(monsterId, pid)
					isMonsterInArea = 1
				end
			end
		end
 
		if(isPlayerInArea == 1 or (isPlayerInArea == 1 and isMonsterInArea == 1)) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You sense a mighty force coming from the portal. Better wait until it fades off.")
			doTeleportThing(cid, lastPosition)
		elseif(isMonsterInArea == 1) then
			doRemoveCreature(monsterId)
			doTeleportThing(cid, newPos)
			doCreateMonster(monsterName, monsterPos)
		end
 
		monsterId = {}
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "The energy coming from the portal does not lets you pass through.")
		doTeleportThing(cid, lastPosition)
	end
 
	return true
end

Can you change messages to:
[1. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '" .. getCreatureName(cid) .." is in the room now. Wait a moment!')
2. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')]?
 
Try now...
Lua:
local isMonsterInArea = 0
local monsterId = nil
local monsterName = {"Pythius The Rotten"}
local storageKey = 9933
local monsterPos = {
	x = 333,
	y = 837,
	z = 15
}
local newPos = {
	x = 326,
	y = 840,
	z = 15
}
local areaPos = {
	z = 15,
	fromPos = {
		x = 320,
		y = 828
	},
	toPos = {
		x = 345,
		y = 847
	}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(getCreatureStorage(cid, storageKey) < 0) then
		for xPosition = areaPos.fromPos.x, areaPos.toPos.x do
			for yPosition = areaPos.fromPos.y, areaPos.toPos.y do
				local pos = {x = xPosition, y = yPosition, z = areaPos.z, stackpos = STACKPOS_TOP_CREATURE}
				local pid = getThingfromPos(pos).uid
				if(isPlayer(pid) == 1) then
					doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "" .. getCreatureName(pid) .. " is in the room now. Wait a moment!")
					doTeleportThing(cid, lastPosition)
					return true
				elseif((isMonster(pid) == 1) and (isInArray(monsterName, getCreatureName(pid)))) then
					monsterId = pid
					isMonsterInArea = 1
				end
			end
		end

		if(isMonsterInArea == 1) then
			doRemoveCreature(monsterId)
			doTeleportThing(cid, newPos)
			doCreateMonster(monsterName, monsterPos)
			monsterId = {}
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sorry you already did this quest!")
		doTeleportThing(cid, lastPosition)
	end

	return true
end

The hell...
Code:
if([COLOR="#FF0000"]getCreatureStorage(cid, storageKey) [B]>[/B] 0[/COLOR]) then
Code:
if([COLOR="#FF0000"]getCreatureStorage(cid, storageKey) [B][COLOR="#008000"]<[/COLOR][/B] 0[/COLOR]) then
The last script should work then too...just a stupidity I did with the arithmetic symbols.
 
Last edited:
Try now...
Lua:
local isMonsterInArea = 0
local monsterId = nil
local monsterName = {"Pythius The Rotten"}
local storageKey = 9933
local monsterPos = {
	x = 333,
	y = 837,
	z = 15
}
local newPos = {
	x = 326,
	y = 840,
	z = 15
}
local areaPos = {
	z = 15,
	fromPos = {
		x = 320,
		y = 828
	},
	toPos = {
		x = 345,
		y = 847
	}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(getCreatureStorage(cid, storageKey) < 0) then
		for xPosition = areaPos.fromPos.x, areaPos.toPos.x do
			for yPosition = areaPos.fromPos.y, areaPos.toPos.y do
				local pos = {x = xPosition, y = yPosition, z = areaPos.z, stackpos = STACKPOS_TOP_CREATURE}
				local pid = getThingfromPos(pos).uid
				if(isPlayer(pid) == 1) then
					break
					doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "" .. getCreatureName(pid) .. " is in the room now. Wait a moment!")
					doTeleportThing(cid, lastPosition)
					return true
				elseif((isMonster(pid) == 1) and (isInArray(monsterName, getCreatureName(pid)))) then
					monsterId = pid
					isMonsterInArea = 1
				end
			end
		end

		if(isMonsterInArea == 1) then
			doRemoveCreature(monsterId)
			doTeleportThing(cid, newPos)
			doCreateMonster(monsterName, monsterPos)
			monsterId = {}
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sorry you already did this quest!")
		doTeleportThing(cid, lastPosition)
	end

	return true
end

The hell...
Code:
if([COLOR="#FF0000"]getCreatureStorage(cid, storageKey) [B]>[/B] 0[/COLOR]) then
Code:
if([COLOR="#FF0000"]getCreatureStorage(cid, storageKey) [B][COLOR="#008000"]<[/COLOR][/B] 0[/COLOR]) then
The last script should work then too...just a stupidity I did with the arithmetic symbols.

Lua:
local isPlayerInArea, isMonsterInArea = 0, 0
local monsterId = {}
local monsterName = {"Pythius The Rotten"}
local storageKey = 9933
local monsterPos = {
	x = 333,
	y = 837,
	z = 15
}
local newPos = {
	x = 326,
	y = 840,
	z = 15
}
local areaPos = {
	z = 15,
	fromPos = {
		x = 320,
		y = 828
	},
	toPos = {
		x = 345,
		y = 847
	}
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(getCreatureStorage(cid, storageKey) < 0) then
		for xPosition = areaPos.fromPos.x, areaPos.toPos.x do
			for yPosition = areaPos.fromPos.y, areaPos.toPos.y do
				local pos = {x = xPosition, y = yPosition, z = areaPos.z, stackpos = STACKPOS_TOP_CREATURE}
				local pid = getThingfromPos(pos).uid
				if(isPlayer(pid) == 1) then
					isPlayerInArea = 1
					break
				elseif(isMonster(pid) == 1 and isInArray(monsterName, getCreatureName(pid))) then
					table.insert(monsterId, pid)
					isMonsterInArea = 1
				end
			end
		end
 
		if(isPlayerInArea == 1 or (isPlayerInArea == 1 and isMonsterInArea == 1)) then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "" .. getCreatureName(pid) .. " is in the room now. Wait a moment!")
			doTeleportThing(cid, lastPosition)
		elseif(isMonsterInArea == 1) then
			doRemoveCreature(monsterId)
			doTeleportThing(cid, newPos)
			doCreateMonster(monsterName, monsterPos)
		end
 
		monsterId = {}
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sorry you already did this quest!")
		doTeleportThing(cid, lastPosition)
	end
 
	return true
end

When player stepin nothing happens, no teleport and no errors.
 
Last edited:
You're using the last script I posted right? Try the one I posted before or just let me remove the "break" from the last one.
 
Back
Top