• 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!

Trainner

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
My script don't have an error, but don't work...
Code:
			---by BomBa---
			--------------

function onStepIn(cid, item, position, fromPosition)
 local stonePos = {x=1765, y=1696, z=9}
	if ((getPlayerSkill(cid, 1) <= 50) or (getPlayerSkill(cid, 2) <= 50) or (getPlayerSkill(cid, 3) <= 50) or (getPlayerSkill(cid, 4) <= 50) or (getPlayerSkill(cid, 5) <= 50) or (getPlayerSkill(cid, 6) <= 50) or (getPlayerSkill(cid, 7) <= 50)) then
	   doMoveCreature(cid, NORTH)
	   doCreateItem(1304, 1, stonePos)
	   addEvent(autoExit, 300 * 1000, cid)
    else
	   doMoveCreature(cid, SOUTH)
 end
 return TRUE
end

function autoExit(cid)
 local playerPos = getCreaturePosition(cid)
 local toPos = {x=1765, y=1697, z=9}
 local stonePos = {1765, y=1696, z=9, stackpos=1}
 local getStone = getThingfromPos(stonePos)
	   doTeleportThing(cid, toPos)
	   doSendMagicEffect(toPos, CONST_ME_TELEPORT)
	   doRemoveItem(getStone.uid, 1)
 return TRUE
end
 
Lol, you forgot a "x=" :)

Code:
			---by BomBa---
			--------------

function onStepIn(cid, item, position, fromPosition)
 local stonePos = {x=1765, y=1696, z=9}
      for x = 1, 7 do
	if getPlayerSkill(cid, x) <= 50 then
	   doMoveCreature(cid, NORTH)
	   doCreateItem(1304, 1, stonePos)
	   addEvent(autoExit, 300 * 1000, cid)
    else
	   doMoveCreature(cid, SOUTH)
 end
end
 return TRUE
end

function autoExit(cid)
 local playerPos = getCreaturePosition(cid)
 local toPos = {x=1765, y=1697, z=9}
 local stonePos = {[U]x=1765[/U], y=1696, z=9, stackpos=1}
 local getStone = getThingfromPos(stonePos)
	   doTeleportThing(cid, toPos)
	   doSendMagicEffect(toPos, CONST_ME_TELEPORT)
	   doRemoveItem(getStone.uid, 1)
 return TRUE
end
 
Code:
function onStepIn(cid, item, position, fromPosition)
 local stonePos = {x=1765, y=1696, z=9, stackpos=1}
      for x = 1, 7 do
	if getPlayerSkill(cid, x) <= 50 then
	   doMoveCreature(cid, NORTH)
	   doCreateItem(1304, 1, stonePos)
	   addEvent(autoExit, 1000*300))
    else
	   doMoveCreature(cid, SOUTH)
 end
end
 return TRUE
end

function autoExit(cid)
 local playerPos = getCreaturePosition(cid)
 local toPos = {x=1765, y=1697, z=9}
 local stonePos = {x=1765, y=1696, z=9, stackpos=1}
 local getStone = getThingfromPos(stonePos)
	   doTeleportThing(cid, toPos)
	   doSendMagicEffect(toPos, CONST_ME_TELEPORT)
	   doRemoveItem(getStone.uid, 1)
 return TRUE
end
 
[01/02/2009 21:11:06] Lua Script Error: [MoveEvents Interface]
[01/02/2009 21:11:06] data/movements/scripts/trainer_rooms/train_001.lua nStepIn

[01/02/2009 21:11:06] luaGetPlayerSkillLevel(). Invalid skillId
 
Now work:
Code:
			---by BomBa---
			--------------

function onStepIn(cid, item, position, fromPosition)
 local stonePos = {x=1765, y=1696, z=9}
	if ((getPlayerSkill(cid, 1) <= 50) or (getPlayerSkill(cid, 2) <= 50) or (getPlayerSkill(cid, 3) <= 50) or (getPlayerSkill(cid, 4) <= 50) or (getPlayerSkill(cid, 5) <= 50) or (getPlayerSkill(cid, 6) <= 50) or (getPlayerSkill(cid, 7) <= 50)) then
	   doMoveCreature(cid, NORTH)
	   doCreateItem(1304, 1, stonePos)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "After five minutes you will leave this place.")
	   addEvent(autoExit, 300 * 1000, cid)
    else
	   doMoveCreature(cid, SOUTH)
 end
 return TRUE
end

function autoExit(cid)
 local playerPos = getCreaturePosition(cid)
 local toPos = {x=1765, y=1697, z=9}
 local stonePos = {x=1765, y=1696, z=9, stackpos=1}
 local getStone = getThingfromPos(stonePos)
	   doTeleportThing(cid, toPos)
	   doSendMagicEffect(toPos, CONST_ME_TELEPORT)
	   doRemoveItem(getStone.uid, 1)
 return TRUE
end

But players of skill 50 or higher can enter... I need that players of skill 50 or lower can enter to train.
 
Now work:
Code:
			---by BomBa---
			--------------

function onStepIn(cid, item, position, fromPosition)
 local stonePos = {x=1765, y=1696, z=9}
	if ((getPlayerSkill(cid, 1) >= 50) or (getPlayerSkill(cid, 2) >= 50) or (getPlayerSkill(cid, 3) >= 50) or (getPlayerSkill(cid, 4) >= 50) or (getPlayerSkill(cid, 5) >= 50) or (getPlayerSkill(cid, 6) >= 50) or (getPlayerSkill(cid, 7) >= 50)) then
	   doMoveCreature(cid, NORTH)
	   doCreateItem(1304, 1, stonePos)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "After five minutes you will leave this place.")
	   addEvent(autoExit, 300 * 1000, cid)
    else
	   doMoveCreature(cid, SOUTH)
 end
 return TRUE
end

function autoExit(cid)
 local playerPos = getCreaturePosition(cid)
 local toPos = {x=1765, y=1697, z=9}
 local stonePos = {x=1765, y=1696, z=9, stackpos=1}
 local getStone = getThingfromPos(stonePos)
	   doTeleportThing(cid, toPos)
	   doSendMagicEffect(toPos, CONST_ME_TELEPORT)
	   doRemoveItem(getStone.uid, 1)
 return TRUE
end

But players of skill 50 or higher can enter... I need that players of skill 50 or lower can enter to train.


:) now works (i think)
 
Now skill 50+ can enter and skill 50- don't enter...
I have edited:
Code:
			---by BomBa---
			--------------

function onStepIn(cid, item, position, fromPosition)
 local stonePos = {x=1765, y=1696, z=9}
	if ((getPlayerSkill(cid, 1) < 50) or (getPlayerSkill(cid, 2) < 50) or (getPlayerSkill(cid, 3) < 50) or (getPlayerSkill(cid, 4) < 50) or (getPlayerSkill(cid, 5) < 50) or (getPlayerSkill(cid, 6) < 50) or (getPlayerSkill(cid, 7) < 50)) then
	   doMoveCreature(cid, NORTH)
	   doCreateItem(1304, 1, stonePos)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "After five minutes you will leave this place.")
	   addEvent(autoExit, 300 * 1000, cid)
	 elseif ((getPlayerSkill(cid, 1) > 50) or (getPlayerSkill(cid, 2) > 50) or (getPlayerSkill(cid, 3) > 50) or (getPlayerSkill(cid, 4) > 50) or (getPlayerSkill(cid, 5) > 50) or (getPlayerSkill(cid, 6) > 50) or (getPlayerSkill(cid, 7) > 50)) then
	   doMoveCreature(cid, SOUTH)
 end
  return TRUE
end

function autoExit(cid)
 local playerPos = getCreaturePosition(cid)
 local toPos = {x=1765, y=1697, z=9}
 local stonePos = {x=1765, y=1696, z=9, stackpos=1}
 local getStone = getThingfromPos(stonePos)
	   doTeleportThing(cid, toPos, 1)
	   doSendMagicEffect(toPos, CONST_ME_TELEPORT)
	   doRemoveItem(getStone.uid, 1)
 return TRUE
end

But don't work too...
 
Back
Top