• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Training System

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Reaction score
152
Location
00
So, I made this training system for a friend, you can see what it does in this video:
YouTube - New Training System! OTServ
So lets get started
data/movements/movements.xml
XML:
	<movevent type="StepIn" uniqueid="5000-5003" event="script" value="Training System.lua"/>
<movevent type="StepOut" uniqueid="5000-5003" event="script" value="Training System.lua"/>

data/movements/scripts/Training System.lua
Lua:
function onStepIn(cid, item, pos, fromPos)
	local t = {
		[5000]={{x=pos.x-1, y=pos.y+1, z=pos.z},{x=pos.x-1, y=pos.y-1, z=pos.z}},
		[5001]={{x=pos.x+1, y=pos.y+1, z=pos.z},{x=pos.x+1, y=pos.y-1, z=pos.z}},
		[5002]={{x=pos.x+1, y=pos.y-1, z=pos.z},{x=pos.x-1, y=pos.y-1, z=pos.z}},
		[5003]={{x=pos.x+1, y=pos.y+1, z=pos.z},{x=pos.x-1, y=pos.y+1, z=pos.z}}
	}
	local v = t[item.uid]
	if v then
		doSummonCreature('training monk', v[1])
		doSummonCreature('training monk', v[2])
		doSendMagicEffect(v[1],CONST_ME_TELEPORT)
		doSendMagicEffect(v[2],CONST_ME_TELEPORT)
	end
end

function onStepOut(cid, item, pos)
	local t = {
		[5000]={{x=pos.x-1, y=pos.y+1, z=pos.z, stackpos = 253},{x=pos.x-1, y=pos.y-1, z=pos.z, stackpos = 253}},
		[5001]={{x=pos.x+1, y=pos.y+1, z=pos.z, stackpos = 253},{x=pos.x+1, y=pos.y-1, z=pos.z, stackpos = 253}},
		[5002]={{x=pos.x+1, y=pos.y-1, z=pos.z, stackpos = 253},{x=pos.x-1, y=pos.y-1, z=pos.z, stackpos = 253}},
		[5003]={{x=pos.x+1, y=pos.y+1, z=pos.z, stackpos = 253},{x=pos.x-1, y=pos.y+1, z=pos.z, stackpos = 253}}
	}
	local v = t[item.uid]
	if v then
		doRemoveCreature(getThingfromPos(v[1]).uid)
		doRemoveCreature(getThingFromPos(v[2]).uid)
		doSendMagicEffect(v[1],CONST_ME_POFF)
		doSendMagicEffect(v[2],CONST_ME_POFF)
		end
end

Set it up like this:
trainingsysttem.png
[/URL]

Its not a hard script, but since Im still kinda noob at LUA it wasnt easy for me :p
Special thanks to Jano and Cyko, that made me understand how to fix one thing.
Enjoy!
 
Last edited:
are you referring in that that the use of it is that you made fora friend? or you showing me what is the use of it through me watching the video

@down

I just thought you got me wrong , so was trying to see how you got my words :p
 
Last edited:
are you referring in that that the use of it is that you made fora friend? or you showing me what is the use of it through me watching the video

Gosh, dude, I made that script for a friend, and now Im releasing it.
The video shows what the script does!

EDIT:Up: Oki no worries :>
 
Last edited:
Back
Top