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

Change target.

Hindori

New Member
Joined
Jan 24, 2009
Messages
157
Reaction score
2
Hello i need made script (it can be creturescript or source edit) that when i summon monster change all monster target who atacking me to my summon. I'm using tfs 0.3.6pl1
 
Lua:
function onAttack(cid, target)
	if #getCreatureSummons(cid) >= 1 then
		doMonsterSetTarget(target, getCreatureSummons(cid)[1])
	else
		doMonsterSetTarget(target, cid)  
	end
	
	return true 
end
 
it must be called "attackchange"
Lua:
function onAttack(cid, target)
	if #getCreatureSummons(target) >= 1 then
		doMonsterSetTarget(cid, getCreatureSummons(target)[1])
	else
		doMonsterSetTarget(cid, target)  
	end

now to call the script when the monster attack you will need do this.. for ALL monsters =(
Now in all monsters:
Code:
  <script>
<event name="attackchange"></event>
</script>

...didn`t test it...
 
it must be called "attackchange"
Lua:
function onAttack(cid, target)
	if #getCreatureSummons(target) >= 1 then
		doMonsterSetTarget(cid, getCreatureSummons(target)[1])
	else
		doMonsterSetTarget(cid, target)  
	end

now to call the script when the monster attack you will need do this.. for ALL monsters =(
Now in all monsters:
Code:
  <script>
<event name="attackchange"></event>
</script>

...didn`t test it...

Nope. It mustn't you only change the name of script... Name of script is randomly changed by user. You can set name to "evil shit" and it will be the same...
 
Back
Top