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

StepOn StepOff script

GhostX

Mapping Board Moderator
Joined
Nov 2, 2011
Messages
6,051
Reaction score
1,817
Location
UK
Twitch
ghostxpr0
I need a script is applied to a tile. And it allows all players and/or non hostiles to walk through, but if a creature steps on it, it deletes it or teleports back to spawn point.

Intention: Stops people luring into towns.
Doesn't matter if player has skull etc, all i want is a tile that wont allow a creature to pass it. BUT, i don't want town to be monster free, for example (raids) i just want a script for a tile that i can place at the gates.


Many thanks in advance.
 
LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if not isPlayer(cid) then
		doRemoveCreature(cid)
	end
	return true
end
You can set the ID of the tile in movements.xml
 
Or if you dont want the creature pass the tile instead of getting removed you can add this:
This simple push the creature 1sqm back!

Code:
function onStepIn(cid, item, position, fromPos, fromPosition)
	if isCreature(cid) then
	doTeleportThing(cid, fromPosition, false)
 		end
	return true
end
 
LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if isPlayer(cid) then
		doTeleportThing(cid, fromPosition, false)
	else
		
	end
	return true
end
 
That will just push the player from the tile :o

LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if isPlayer(cid) then
		doTeleportThing(cid, fromPosition, false)
	else
		
	end
	return true
end
 
That will just push the player from the tile :o

It won't teleport player to frompos?

Or if you dont want the creature pass the tile instead of getting removed you can add this:
This simple push the creature 1sqm back!

Code:
function onStepIn(cid, item, position, fromPos, fromPosition)
	if isCreature(cid) then
	doTeleportThing(cid, fromPosition, false)
 		end
	return true
end
If it removes creature it'll spawn at the old position no? :P
 
Korrex's worked fine, and i don't want it to push back the creature since people would just lure to city gates in rook and not exactly handy for new players is it lol
 
Back
Top