Help needed. Confusion is afoot

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

Brebro

Member
Aug 10, 2019
1
0
0
24
So to describe what my problem is you (the reader) needs to know what Capture the flag is (if you live under a rock).
CTF in short:
1: Teams of players (usually only 2 teams) try to capture (by breaking) other teams flag
2: Teams are meant to PvP to prevent this from happening.
3: Once captured the enemies wool has to be delivered back to base
4: If killed while the Flag is in hand, it is dropped on death (in my case placed at point of death)
5: If enemy flag is laying on ground. break to grab and carry on.
(this \/is where my problem lies)
6: If friendly flag is laying on ground. break it to put it back at place of origin.
Code:
#{crf.loc} = current red flag location (where is was dropped)
#{rf.loc} = where the flag should be at base
on break of red wool or blue wool:
    if block is red wool:
        if {team.%player%} is "red":
            if location is {crf.loc}: 
                set block at {rf.loc} to red wool 
 #below here the code works fine
            if location is {rf.loc}:
                message "{@pref} You cant break your own flag."
                cancel event

I must either be Completely blind or something is severely wrong. I've had 3 people look at my skript with no luck so far.
If you feel obligated here is the full code (NOTE: I have not finished coding the blue flag as I wanted to figure out the problem first, so in testing only use red flag): https://pastebin.com/LEfaLe6w
I am brand new to Skript, I only know python so I felt as if this would be a cool transition into a game I play often.
[doublepost=1565590573,1565499632][/doublepost]Delete please, Fixed
 
Status
Not open for further replies.