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

Lua Function to make stop attacking

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Reaction score
152
Location
00
So, I need to know if theres any function that will make you cannot attack a monster
Lua:
function onTarget(cid, target)
       if isMonster(target) then
            ---- You cant atk monster for 'x' time ----
 
Last edited:
Just give the monster immunities to everything? :p

Lua:
  <immunities>
    <immunity physical="1"/>
    <immunity energy="1"/>
    <immunity fire="1"/>
    <immunity poison="1"/>
    <immunity lifedrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity drunk="1"/>
    <immunity invisible="1"/>
  </immunities>
 
Just give the monster immunities to everything? :p

Lua:
  <immunities>
    <immunity physical="1"/>
    <immunity energy="1"/>
    <immunity fire="1"/>
    <immunity poison="1"/>
    <immunity lifedrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity drunk="1"/>
    <immunity invisible="1"/>
  </immunities>
how many seconds :[?
read plzzzzzzzzzz
 
In the monster file add this line in the flags


Code:
>>function onTarget(cid, target)
       if isMonster(target) then
            ---- You cant atk monster for 'x' time ----
Code:
>>if isMonster(target) then
            ---- You cant atk monster for 'x' time ----
Code:
>>---- You cant atk monster for 'x' time ----
Code:
>>for 'x' time ----
ffs ppl should read before posting
 
@Up: You made me laugh haha
Bump! I need the function, of course this is not for all monsters, this has more conditions, what I put was just an example.
I need to know if theres any function tho
 
set a certain storage value and onCombat(or smth else), you reduce the set storage by 1 and if the storage is lower than 0 or smth you return true and otherwise false.
return true will make the player do damage normally and return false will stop the damage
 
Back
Top