Protecting an Item

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

DannyDaMannyy

Member
Dec 16, 2023
20
1
3
Hello, I just posted a question about looping, but I realize I have another issue as well, that's mostly unrelated. Thanks in advance for any help! As mentioned, I am developing a Capture the Flag server with some twists, and I've just realized I dont know how to protect the flag while in transit.
Issues:
1. The flag can be dropped in the void, thrown at a cactus, burned, or the player holding it could die in the void. I need to avoid any of these things happening, obviously, or at least have some skript create a new flag when any of these things does happen.
Solutions I've considered:
1. Having a flag be recreated when the original is destroyed. (But I dont know how to detect when it is destroyed)
2. Having the flag never even enter inventory, and just attach to the players head when they click it. (But I can't figure out how to place the banner on the head, and it doesnt protect it from the player dying by some means)

I understand I've kind of requested a little much here, but if anyone has any ideas, PLEASE HELP me out! Very new to Skript.

Here is an example of a skript I have to place the flag on the players head: (Issue with it is 1. if I write "black_banner" instead of "banner" it runs into errors, and otherwise I get a random banner, half the time! and 2. It doesnt have a solution to if the player dies in the void or something.)

Maybe the answer is to combine the two solutions, and put the flag on the head, but also replace the flag automatically when its destroyed? If so, can I have help editing my code to do that?
 

Attachments

  • PutFlagOnHead.sk
    1.9 KB · Views: 210
I would just help you solve it, but this community is so stupid I've given up on actually helping.
 

Attachments

  • PutFlagOnHead.sk
    1.1 KB · Views: 227
LOL I understand why you see it that way. Well Ill run this through, but ive already learned something, because the function section at the bottom I hadnt even considered. Thank you! Will keep you posted on results
-Dan
 
Ran it through, and after changing some of the spacings it worked! Now I just have to figure out how to get the flag off the head, and stop them from removing it from their head manually. I think I can figure those two things out, but if you have any ideas, you seem to know your stuff :emoji_wink:
Thanks so much! -Dan