Eggwars egg error

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

Geometrysten

Member
Jul 22, 2019
2
0
1
Hi, i'm trying to make eggwars in Skript, but i've came over an issue.
Here's the code:
Code:
on click on dragon egg:
    if player is sneaking:
        stop
    set {_locarara} to location of player's targeted block
    if {_locarara} = {BlueEgg}:
        if {team.%player%} = "blue":
            send "&cYou can't destroy your own egg!"
            cancel event
        else:
            set block at {_locarara} to air
            loop all players:  
                if {team.%loop-player%} is "blue":
                    send subtitle "&4&lYour egg has been destroyed!" to loop-player for 5 seconds
    else if {_locarara} = {RedEgg}:
        if {team.%player%} = "red":
            send "&cYou can't destroy your own egg!"
            cancel event
        else:
            set block at {_locarara} to air
            loop all players:  
                if {team.%loop-player%} is "red":
                    send subtitle "&4&lYour egg has been destroyed!" to loop-player for 5 seconds
on block flow:
    if event-block is dragon egg:
        cancel event
So basiclly, when i right click at my own egg, it sends me "You cant destroy your own egg!". And if im sneaking and right clicking my own egg WHEN holding something, i can place it. Altough, if i sneak while holding nothing and right click at my egg, it disappears

And also when i right click at my enemies egg, it doesn't just disappear, it teleports.

Sorry for messy code but
Please help
 
Status
Not open for further replies.