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

Help please!

Seanr

New Member
Joined
Jul 11, 2011
Messages
168
Reaction score
3
Location
Mo Town
/data/config.lua
Lua Code:
LUA:
noDamageToGuildMates = true -- if true then no damage, if false then damage
noDamageToPartyMembers = true -- if true then no damage, if false then damage


/creaturescripts/scripts/partyAndGuildProtection.lua
LUA:
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 false
            end
        end
    end
    return true
end

/creaturescripts/creaturescripts.xml
XML:
<event type="combat" name="partyAndGuildProtection" event="script" value="partyAndGuildProtection.lua"/>


/creaturescripts/scripts/login.lua
Lua Code:
LUA:
registerCreatureEvent(cid, "partyAndGuildProtection")


Simply, when config values are set to true then players with the same guild or in the same party can't deal damage to eachother.




I have copied this from another post but when I use it my world is set to non-pvp and not jusst in paries or guild. can someone help?
 
Last edited by a moderator:
I don't understand what you mean, could you please try to define what exactly the problem is and what you want it to do?

When he uses this script, nobody can attack eachother, regardless of whether you're in a party/guild or not.
 
Back
Top