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

Monsters Script/Rep++

-.Savage.-

New Member
Joined
Jul 2, 2008
Messages
32
Reaction score
2
Hello,
Script I Need:
If Monster Has Same Outfit Colors It Will Not Attack You.

Why: Because I have a pvp enf servers with teams and these teams have Kings
so u can defend your king without your king Killing you.

ill give rep++++ please and thanks
 
Lua:
function onCombat(cid, target)

local cidOutfit = getCreatureOutfit(cid)
local tOutfit = getCreatureOutfit(target)

	if(isPlayer(cid) and isMonster(target) and getCreatureName(target) == "KING_1" or getCreatureName(target) == "KING_2") or (isPlayer(target) and isMonster(cid) and getCreatureName(cid) == "KING_1" or getCreatureName(cid) == "KING_2") then
		if cidOutfit == tOutfit then
			return FALSE
		end
	end
	return TRUE
end

Add this to creaturescripts.xml
Lua:
<event type="combat" name="attackKing" event="script" value="SCRIPT_NAME.lua"/>

This to login.lua
Lua:
	registerCreatureEvent(cid, "attackKing")

And this to you monster-file
After </flags> add...
Lua:
<script>
<event name="attackKing"/>
</script>

Maybe it works... Not Tested!!
 
@/\ up

EXAMPLE.


PHP:
  <strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="1"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="1"/>
    <flag convinceable="1"/>
    <flag pushable="0"/>
    <flag canpushitems="1"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="0"/>
  </flags>


and you add:

PHP:
<script>
<event name="attackKing"/>
</script>

looks:

PHP:
 <flags>
    <flag summonable="1"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="1"/>
    <flag convinceable="1"/>
    <flag pushable="0"/>
    <flag canpushitems="1"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="0"/>
  </flags>
<script>
<event name="attackKing"/>
</script>
 
Back
Top