/data/config.lua
Lua Code:
/creaturescripts/scripts/partyAndGuildProtection.lua
/creaturescripts/creaturescripts.xml
/creaturescripts/scripts/login.lua
Lua Code:
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?
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: