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

[HELP] Movement Script <Advanced?>

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,782
Solutions
25
Reaction score
491
Location
Sweden
Hello otland! I'm requesting some help with my movement script. Let me explain how it works. When I stand where I stand (in the screenshot below), and walk south, a warlock shall be summoned (position I can set myself) and a magic wall will be created on the spot, but if I walk north, the warlock shall not spawn, but the mwall shall appear to block. Here is a screenshot of the room:

28317167.jpg


Here is my script so far:

LUA:
function onStepOut(cid, item, position, fromPosition) 
	doCreateItem(1497, 1, position)
	creaturepos = {x=1211, y=588, z=12}
	doSummonCreature("Warlock", creaturepos)
end

I would be really, really, really thankfull if someone could spare some time and help me with this!

Thanks for now!
 
Use global/player storage or loop through tiles to check if the warlock is already summoned at all/by that player.
 
Well, sounds like that would work aswell, but still doesn't quite solves my problem, my problem is that I can't write my own scripts, that's why I'm requesting :P
 
That:, if you stand like Realistic stand in the picture and walk north, no warlock shall be spawned, but a magic wall shall appear on the spot, but if you walk south V then a warlock shall spawn and a magic wall shall appear!
 
I'm not =) but for a guy like me it's super duper dope advanced, I just hope someone spares some time to help me out
 
I'll try make it :p The warlocks won't spawn if you already done it

ServerDirectory/mods/Monster_Tile.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Monster_Tile" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
		
	local cfg = {
			action = XXXX, -- The action id of the lever		
			itemID = XXXX, -- ID of the item that should be created
			monster = warlock, -- Name of the monster that should be summoned
			monsterPos = { x = XXXX, y = YYYY, z = ZZZ }, -- Position where the monster should spawn
			storage = XXXX, -- Storage the player get after the monster are summoned
				}

	 <movevent type="StepOut" actionid="cfg.action" event="script"><![CDATA[
	 
		if item.actionid == cfg.action then
			if (fromPosition.x == getPlayerPosition(cid).x-1 and fromPosition.y == getPlayerPosition(cid).y+1) or (fromPosition.x == getPlayerPosition(cid).x and fromPosition.y == getPlayerPosition(cid).y+1) or (fromPosition.x == getPlayerPosition(cid).x+1 and fromPosition.y == getPlayerPosition(cid).y+1) then
				doCreateItem(fromPosition, cfg.itemID, 1)
			end
		end
		
		if item.actionid == cfg.action then
			if getPlayerStorageValue(cid, cfg.storage) ~= 1 then
				if (fromPosition.x == getPlayerPosition(cid).x-1 and fromPosition.y == getPlayerPosition(cid).y-1) or (fromPosition.x == getPlayerPosition(cid).x and fromPosition.y == getPlayerPosition(cid).y-1) or (fromPosition.x == getPlayerPosition(cid).x+1 and fromPosition.y == getPlayerPosition(cid).y-1) then
					doSummonCreature(cfg.monster, cfg.monsterPos)
					doCreateItem(fromPosition, cfg.itemID, 1)
					setPlayerStorageValue(cid, cfg.storage, 1)
				end
			end
		end
	return TRUE
	]]></movevent>
</mod>
Cyko might see what's wrong if there is something wrong(which I think it is :))
 
I'll try make it :p The warlocks won't spawn if you already done it

ServerDirectory/mods/Monster_Tile.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Monster_Tile" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
		
	local cfg = {
			action = XXXX, -- The action id of the lever		
			itemID = XXXX, -- ID of the item that should be created
			monster = warlock, -- Name of the monster that should be summoned
			monsterPos = { x = XXXX, y = YYYY, z = ZZZ }, -- Position where the monster should spawn
			storage = XXXX, -- Storage the player get after the monster are summoned
				}

	 <movevent type="StepOut" actionid="cfg.action" event="script"><![CDATA[
	 
		if item.actionid == cfg.action then
			if (fromPosition.x == getPlayerPosition(cid).x-1 and fromPosition.y == getPlayerPosition(cid).y+1) or (fromPosition.x == getPlayerPosition(cid).x and fromPosition.y == getPlayerPosition(cid).y+1) or (fromPosition.x == getPlayerPosition(cid).x+1 and fromPosition.y == getPlayerPosition(cid).y+1) then
				doCreateItem(fromPosition, cfg.itemID, 1)
			end
		end
		
		if item.actionid == cfg.action then
			if getPlayerStorageValue(cid, cfg.storage) ~= 1 then
				if (fromPosition.x == getPlayerPosition(cid).x-1 and fromPosition.y == getPlayerPosition(cid).y-1) or (fromPosition.x == getPlayerPosition(cid).x and fromPosition.y == getPlayerPosition(cid).y-1) or (fromPosition.x == getPlayerPosition(cid).x+1 and fromPosition.y == getPlayerPosition(cid).y-1) then
					doSummonCreature(cfg.monster, cfg.monsterPos)
					doCreateItem(fromPosition, cfg.itemID, 1)
					setPlayerStorageValue(cid, cfg.storage, 1)
				end
			end
		end
	return TRUE
	]]></movevent>
</mod>
Cyko might see what's wrong if there is something wrong(which I think it is :))

Say what now? I'm requesting a movement script :p
 
Oh didn't see he had a 7.72 or lower haha
nevermind then, don't care about my script XD

It is a movement script. But in MOD. and your server doesn't support MODs i suppose because it's <<7.72
 
I'll try make it :p The warlocks won't spawn if you already done it

ServerDirectory/mods/Monster_Tile.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Monster_Tile" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">
		
	local cfg = {
			action = XXXX, -- The action id of the lever		
			itemID = XXXX, -- ID of the item that should be created
			monster = warlock, -- Name of the monster that should be summoned
			monsterPos = { x = XXXX, y = YYYY, z = ZZZ }, -- Position where the monster should spawn
			storage = XXXX, -- Storage the player get after the monster are summoned
				}

	 <movevent type="StepOut" actionid="cfg.action" event="script"><![CDATA[
	 
		if item.actionid == cfg.action then
			if (fromPosition.x == getPlayerPosition(cid).x-1 and fromPosition.y == getPlayerPosition(cid).y+1) or (fromPosition.x == getPlayerPosition(cid).x and fromPosition.y == getPlayerPosition(cid).y+1) or (fromPosition.x == getPlayerPosition(cid).x+1 and fromPosition.y == getPlayerPosition(cid).y+1) then
				doCreateItem(fromPosition, cfg.itemID, 1)
			end
		end
		
		if item.actionid == cfg.action then
			if getPlayerStorageValue(cid, cfg.storage) ~= 1 then
				if (fromPosition.x == getPlayerPosition(cid).x-1 and fromPosition.y == getPlayerPosition(cid).y-1) or (fromPosition.x == getPlayerPosition(cid).x and fromPosition.y == getPlayerPosition(cid).y-1) or (fromPosition.x == getPlayerPosition(cid).x+1 and fromPosition.y == getPlayerPosition(cid).y-1) then
					doSummonCreature(cfg.monster, cfg.monsterPos)
					doCreateItem(fromPosition, cfg.itemID, 1)
					setPlayerStorageValue(cid, cfg.storage, 1)
				end
			end
		end
	return TRUE
	]]></movevent>
</mod>
Cyko might see what's wrong if there is something wrong(which I think it is :))
event="buffer"
 
He's also parsing config wrong[?].
i think it should be under the <moveevent> or if hes going to do it like that then
Code:
<config name="as"><![CDATA[
      config = {
      }
]]></config>
then under it
Code:
domodlib('as')
im still not sure of that never tried like that ;S
 
Back
Top