• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved dont want party members to hit eachother

Joined
Mar 24, 2013
Messages
59
Reaction score
9
How can i make it that party members cant hit eachother?

i use gamerzot 8.6 for my server allot edited though :P dunno what TFS or whatever just know its version 8.6 :P

can anyone please explain it to me ?
 
Code:
function onCombat(cid, target)
    if(isPlayer(cid) and isPlayer(target)) then
        if(getConfigValue("noDamageToGuildMates")) then
            if(getPlayerGuildId(cid) == getPlayerGuildId(target)) then
                return false
            end
        end
        if(getConfigValue("noDamageToPartyMembers")) then
            if(getPlayerParty(cid) == getPlayerParty(target)) then
                return true
            end
        end
    end
    return true
end

Code:
<event type="combat" name="Protection" event="script" value="protection.lua"/>
 
Thanks ! allot

lol i tested it and dunno why doesnt give any errors but party members still kill eachother o_O?
 
Last edited by a moderator:
Code:
function onCombat(cid, target)
     if isPlayer(target) then
         if not getPlayerParty(cid) or not getPlayerParty(target) then
             return true
         end
         if getPlayerParty(cid) == getPlayerParty(target) then
             return false
         end
     end
     return true
end
 
Im useing this and not working
Im useing tfs 0.3.6
8.6 client

This is all in my creaturescripts

Code:
function onCombat(cid, target)
     if isPlayer(target) then
         if not getPlayerParty(cid) or not getPlayerParty(target) then
             return true
         end
         if getPlayerParty(cid) == getPlayerParty(target) then
             return false
         end
     end
     return true
end
Code:
registerCreatureEvent(cid, "Protection")
Code:
<event type="combat" name="Protection" event="script" value="protection.lua"/>
 
Works fine for me on TFS 0.3.6, you can test if the script is loading by adding this under function onCombat.
Code:
print("Script load test.")
If it loads, you will get that message in your console if a player does a combat/attacks someone/something.
 
Back
Top