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

CreatureEvent Anti-Push

J.Dre

Unity Games
Joined
May 18, 2011
Messages
2,647
Solutions
3
Reaction score
648
Location
United States
Hey everyone!

I'm releasing another script that I've seen attempted many times within the requests section. I did thoroughly test the scripts within the requests board and none of them worked properly. I decided to give it a shot myself and guess what? It works! ;)

How does it work? Tested on TFS 0.3.7 (Client 9.46)
This will prevent players from pushing other players while they are training on certain monsters. However, it will allow "Gods" to push players.

creaturescripts.xml
XML:
<event type="push" name="Anti-Push" event="script" value="anti-push.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "Anti-Push")
anti-push.lua
Lua:
local targetList, GAMEMASTER = {"Target Dummy"}, 5
function onPush(cid, target)
	if(getPlayerAccess(cid) < GAMEMASTER) then
		if((target ~= cid and isPlayer(target)) and (getCreatureTarget(target) > 0 and isInArray(targetList, getCreatureName(getCreatureTarget(target)):lower()))) then
			doPlayerSendCancel(cid, "You cannot move this object.")
			return false
		end
	end
 
	return true
end
I'm sure many of you will appreciate it. :cool:
 
Last edited:
Atem to index a bollean value , no work.
No can push other player.
 
It works fine for me

QICkd.png





EDIT: Ohhhh I see what you mean now, mmmm
 
There are no errors when I use this script. I'm using TFS 0.3.7.

The player you are pushing must be attacking the "target dummy" or whatever monster.
 
Look, i modified your script so i don't have that error while trying to push somebody with no target.

Lua:
if(isPlayer(target) and (getCreatureTarget(target) > 0 and isInArray(targetList, getCreatureName(getCreatureTarget(target)):lower()))) then

If you want players to be able to push themselfs, just add
Lua:
target ~= cid
on if statement.

Nice script, i'll use it.

Thanks.
 
I like the idea! Great script!

Red
 
I could be wrong, but you cannot simply add to monster file, at "flags":
XML:
    <flag pushable="0"/>
?
 
Back
Top