Problem with "victim is the member of the region"

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

Status
Not open for further replies.

LordBoos

New Member
Mar 1, 2017
5
0
0
Skript Version: dev24b
Skript Author: bensku
Minecraft Version: 1.11

---
Full Code:
code_language.skript:
Options:
  Prefix: &e&lprefix&6&l>
  Res_defense_attacker: &ccannot attack member of res
  Res_defense_victim: &ccannot be attacked in res

on damage:
  victim is a player
  victim is online
  victim is the member of the region
  attacker is not the victim
  attacker is online
  cancel event
  if {res_defense_attacker.%attacker%} is not set:
    message "{@Prefix} {@Res_defense_attacker}" to attacker
    set {res_defense_attacker.%attacker%} to true             
    wait 5 seconds
    delete {res_defense_attacker.%attacker%}
  if {res_defense_victim.%victim%} is not set:
    message "{@Prefix} {@Res_defense_victim}" to victim
    set {res_defense_victim.%victim%} to true
    wait 5 seconds
    delete {res_defense_victim.%victim%}

Errors on Reload:

code_language.skript:
Can't compare an entity with 'the member of the region' (skript.sk, line 9: victim is the member of the region')

Other Useful Info:
What I'm trying to achieve is to disable attacker from attacking players in region, if victim is member of region currently standing in. Members of the region should be able to attack outsiders to defend their region.

Troubleshooting:

Have you tried searching the docs?
Yes
Have you tried searching the forums?
Yes
What other methods have you tried to fix it?
Googling similar problems, trying to parse victim as player to variable first
 
You need to add a comparison of a region in your region member condition.

By the looks of your code, you're trying to check if the victim is a member of the region at the event location.
code_language.skript:
on damage of player:
    victim is member of region at event-location
    attacker is not the victim
    cancel event
This should solve what you're trying to do. If it still throws the same error. Make sure you have a supported regions plugin installed like WorldGuard and that it's enabled and working.
 
@LimeGlass

I've changed the code to
code_language.skript:
on damage of player:
  victim is online
  victim is the member of the region at event-location
  attacker is not the victim
  attacker is online
  cancel event

Still the same problem as before:
code_language.skript:
Can't compare an entity with 'the member of the region at event-location' (skript.sk, line 3: victim is the member of the region at event-location')

And yes, I have WorldGuard and PreciousStones (for which I'm trying to create it) installed and working.
 
Last edited by a moderator:
@LimeGlass

I've changed the code to
code_language.skript:
on damage of player:
  victim is online
  victim is the member of the region at event-location
  attacker is not the victim
  attacker is online
  cancel event

Still the same problem as before:
code_language.skript:
Can't compare an entity with 'the member of the region at event-location' (skript.sk, line 3: victim is the member of the region at event-location')

And yes, I have WorldGuard and PreciousStones (for which I'm trying to create it) installed and working.
You can't put the word the in the syntax. It's an older Skript syntax so it doesn't include [the] and [a] in the syntax. Like my example above doesn't use the.
 
  • Like
Reactions: LordBoos
Status
Not open for further replies.