Solved Skript help: so i am trying to make a skript where some groups cannot hit eachother

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

habbic

Member
Mar 18, 2024
30
0
6
Code:
on damage:
    if player's group = "security-base" or "security-rtu" or "security-dir"
        cancel event
    else:
        if player's group = "chaos-base" or "chaos-assassin" or "chaos-trialblazer" or "chaos-commander"
            uncancel event

on damage:
    if player's group = "chaos-base" or "chaos-assassin" or "chaos-trialblazer" or "chaos-commander"
        uncancel event
    else:
        if player's group = "security-base" or "security-rtu" or "security-dir"
            uncancel event
 
Hi! You can't use player in an on damage event.

You msut use attacker and victim.
ive notice but still it dosent work, like the i want the security not able to hit eachother but hit the chaos team, and same applies to chaos, choas team cant hit eachother but they can hit the security
 
You'll need to check the attacker and the victim's groups, like this.
Python:
on damage:
        if victim's group = "security-base" or "security-rtu" or "security-dir":
            if attacker's group = "security-base" or "security-rtu" or "security-dir"
            cancel event
        else if victim's group = "chaos-base" or "chaos-assassin" or "chaos-trialblazer" or "chaos-commander":
            if attacker's group = "chaos-base" or "chaos-assassin" or "chaos-trialblazer" or "chaos-commander"
            cancel event