Solved 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 comminuty!

    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.

TigerPvPzzz

Active Member
Feb 24, 2017
109
2
0
25
Hello there my friends.

So, i'm trying to make a King of The Hill script, and it are actaully going well. BUT, i have a problem...

Im trying to make it like, so when the players go in the region it checks if a koth is going on. So i've made a little test... but this is not actualy working
CODE:
Code:
On region enter:
    If {Koth.Igang.%region%} is set:
        Broadcast "This is a test"
But when im making it "If {variable} is not set" its working fine... Can anyone help with that?
 
I actualy just tried that, but it does not seem to work... But i have an idea, I think its because in my %region% that could be the overall region, i have my KOTH region inside another region... if you understand
 
Hello there my friends.

So, i'm trying to make a King of The Hill script, and it are actaully going well. BUT, i have a problem...

Im trying to make it like, so when the players go in the region it checks if a koth is going on. So i've made a little test... but this is not actualy working
CODE:
Code:
On region enter:
    If {Koth.Igang.%region%} is set:
        Broadcast "This is a test"
But when im making it "If {variable} is not set" its working fine... Can anyone help with that?
How are you setting the region koth variable? it sounds like it's not being set
 
How are you setting the region koth variable? it sounds like it's not being set
Number 2 is just for an confirmation of setting the KOTH

Code:
If arg-1 is "Create":
            If player has permission "kp":
                If arg-2 is set:
                    If {Koth.set.%arg-2%} is not set:
                        If {Koth.Creating.%player%} is not set:
                            Set {Koth.creating.%player%} to arg-2
                            Send "{@p} &3Venstre klik &7for at sætte hjørne 1"
                            Send "{@p} &3Højre klik &7derefter i det modsatte hjørne for at lave &3%arg-2%"
                        Else:
                            Send "{@p} {@f} &3Du er allerede igang med at placere et &6&lKoTH"
                    Else:
                        Send "{@p} {@f} &cDette &6&lKoTH &cer allerede blevet sat!"
                Else:
                    Send "{@p} &3Brug: &b/Koth &7create &3(&7Navn&3)"
            Else:
                Send "{@p} {@f} {@pm}"

#and

If arg-1 is "Accept":
            If {Koth.creating.%player%} is set:
                If {Koth.markeret} is set:
                    If {Loc1} is set:
                        If {Loc2} is set:
                            create wg region "%{Koth.creating.%player%}%" between {Loc1}  and {Loc2} in world "KitPvP"
                            Set {Koth.set.%{Koth.creating.%player%}%} to {Koth.creating.%player%}
                            Wait 1 tick
                            Add {Koth.creating.%player%} to {Koth.List::*}
                            Wait 1 tick
                            Delete {Loc1}
                            Delete {Loc2}
                            Delete {Koth.markeret}
                            Send "{@p} &3Du har nu &alavet &7%{Koth.creating.%player%}%"
                            Delete {Koth.creating.%player%}
                        Else:
                            Send "{@p} {@f} &3Du mangler at sætte punkt nr. &72"
                    Else:
                        Send "{@p} {@f} &3Du mangler at sætte punkt nr. &71"
                Else:
                    Send "{@p} {@f} &3Du har ikke markeret et &6&lKoth"
#Start a KOTH
If arg-1 is "Start":
            If player has permission "{@kp}":
                If arg-2 is set:
                    If {Koth.set.%arg-2%} is set:
                        If arg-3 is set:
                            If {Koth.igang} is not set:
                                Set {Koth.Igang} to arg-2
                                Set {Koth.igang.%arg-2%} to true
                                Set {Koth.Igang.timer::min} to arg-3
                                Set {Koth.Igang.timer::sec} to 0
                                Broadcast "&8&l&m-------| &6&lKoTH &8&l&m|-------"
                                Broadcast " "
                                Broadcast "&3Et &6&lKoTH &3er nu begyndt! &7- &c&l%arg-2%"
                                Broadcast " "
                                Broadcast "&7Find og Cap &c&l%arg-2% &7og modtag episk loot!"
                                Broadcast " "
                                Broadcast "&8&l&m-------| &6&lKoTH &8&l&m|-------"
                            Else:
                                Send "{@p} {@f} &3Der er allerede et &6&lKoTH &6igang!"
                        Else:
                            Send "&3Brug: &b/Koth start &7(&bNavn&7) (&btid)"
                    Else:
                        Send "{@p} {@f} &3Dette &6&lKoTH &3findes ikke!"
                Else:
                    Send "&3Brug: &b/Koth start &7(&bNavn&7) (&btid)"
            Else:
                Send "{@p} {@f} {@pm}"
[doublepost=1502318520,1502318428][/doublepost]https://gyazo.com/afe35dbf6da550ff1bed3fbca5f9c732
test it by adding

send "%region%"
- "Test" is my KOTH name
 
Okay so if I understand this right, you have a command in which you set the region correct? That's where you're pulling arg-2 from? ({Koth.igang.%arg-2%}) If so, then the region name is always "RegionName in world world" so that arg-2 you are setting would need to be typed as RegionName in world KitPvP

elsewise if you say have a region named "test" in that world and your variable is {Koth.igang.test}, it won't be the same as {Koth.igang.%region%}.(which will equal {Koth.igang.test in world KitPvP})
 
Okay so if I understand this right, you have a command in which you set the region correct? That's where you're pulling arg-2 from? ({Koth.igang.%arg-2%}) If so, then the region name is always "RegionName in world world" so that arg-2 you are setting would need to be typed as RegionName in world KitPvP

elsewise if you say have a region named "test" in that world and your variable is {Koth.igang.test}, it won't be the same as {Koth.igang.%region%}.(which will equal {Koth.igang.test in world KitPvP})
Probaly yes. But idk what to use otherwise than {Koth.Igang.%region%}
 
Probaly yes. But idk what to use otherwise than {Koth.Igang.%region%}
you can still use %region%, just when you start your king of the hill game type your command like
/WhateverCommandYouUse Accept Test in world KitPvp
You could alternatively add arg 2 to a list variable and reference it like this:
code_language.skript:
if {testregionlist::*} contains "test":
 
you can still use %region%, just when you start your king of the hill game type your command like
/WhateverCommandYouUse Accept Test in world KitPvp
You could alternatively add arg 2 to a list variable and reference it like this:
code_language.skript:
if {testregionlist::*} contains "test":
I found out how i would do it.
Code:
On region enter:
    If "%region%" is "%{Koth.Igang}% in world KitPvP":
I've tested it, and it worked. This checks if the Koth is going on. Thanks for the help btw.
 
  • Like
Reactions: Wynnevir
Status
Not open for further replies.