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

Training problem

ScorpiOOn93

etherno.net
Joined
Jun 19, 2008
Messages
662
Reaction score
1
Location
CookieLand :DDD
Hello.
I have a training movement script that if player stand on some tile it will crete 2 training monks and it's working, but i think that function "DoCreateMonster()" is bugged because when some player throw a FIRE BOMB or something like that on tile when it should create a training monk it will send a error:
Code:
 [14/10/2009 15:39:50] Lua Script Error: [MoveEvents Interface] 
[14/10/2009 15:39:50] data/movements/scripts/train.lua:onStepIn

[14/10/2009 15:39:50] luaDoCreateMonster(). Cannot create monster: Paladin Trainer
and it will not create a training monk :/

Can someone tell how to fix that or edit this script for something like if player leave the training room it will remove the fire fields etc.

Script:
Code:
 function onStepOut(cid, item, toPosition, fromPosition)

local trainers = {
	["Sorcerer Trainer"] = 1,
	["Druid Trainer"] = 2,
	["Paladin Trainer"] = 3,
	["Knight Trainer"] = 4
}
local trainers2 = {
	["Sorcerer Trainer"] = 5,
	["Druid Trainer"] = 6,
	["Paladin Trainer"] = 7,
	["Knight Trainer"] = 8
}


local positions = {
	[4000] = { {x = toPosition.x-1, y = toPosition.y-1, z = toPosition.z, stackpos = 253}, {x = toPosition.x+1, y = toPosition.y-1, z = toPosition.z, stackpos = 253} }, -- North
	[4001] = { {x = toPosition.x-1, y = toPosition.y+1, z = toPosition.z, stackpos = 253}, {x = toPosition.x+1, y = toPosition.y+1, z = toPosition.z, stackpos = 253} }, -- South
	[4002] = { {x = toPosition.x+1, y = toPosition.y-1, z = toPosition.z, stackpos = 253}, {x = toPosition.x+1, y = toPosition.y+1, z = toPosition.z, stackpos = 253} }, -- East
	[4003] = { {x = toPosition.x-1, y = toPosition.y-1, z = toPosition.z, stackpos = 253}, {x = toPosition.x-1, y = toPosition.y+1, z = toPosition.z, stackpos = 253} }  -- West
}


if getPlayerPromotionLevel(cid) == 0 then
 for trainer, vocation in pairs(trainers) do
				if getPlayerVocation(cid) == vocation then
					for action, position in pairs(positions) do
						if isPlayer(getThingfromPos(getCreaturePosition(cid)).uid) == TRUE then
							if item.actionid == action then

      rem = getThingfromPos(position[1])
      rem2 = getThingfromPos(position[2])
      doRemoveCreature(rem.uid)
      doRemoveCreature(rem2.uid)
       break
       end
      end
     end
    end
 end
elseif getPlayerPromotionLevel(cid) == 1 then
for trainer, vocation in pairs(trainers2) do
				if getPlayerVocation(cid) == vocation then
					for action, position in pairs(positions) do
						if isPlayer(getThingfromPos(getCreaturePosition(cid)).uid) == TRUE then
							if item.actionid == action then

      rem = getThingfromPos(position[1])
      rem2 = getThingfromPos(position[2])
      doRemoveCreature(rem.uid)
      doRemoveCreature(rem2.uid)
      break
      end
     end
    end
   end
 end
end
return TRUE
end
 
Back
Top