Jump to content

My age skript wont work


Ramina__

Recommended Posts

When players join they just close their inv and walk off and because it wont tell me their age (because they didnt pick) i dont know what area they are allowed in 😞 please someone help me with this

 

CODE:

 

on join:
    if {checked::%player%} is not set:
        set {checking::%player%} to "true"
        open chest with 3 rows named "&7Pick your &bage&7:" to player
        format gui slot 11 of player with green wool named "&aJunior" to run:
            set {agestatus::%player%} to "&a&lJUNIOR"
            set {checked::%player%} to "CHECKED"
            send "&7You have selected your age as a &aJunior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &aJunior&7." to loop-player
                    close player's inventory
                    
        format gui slot 15 of player with red wool named "&cSenior" to run:
            set {agestatus::%player%} to "&4&lSENIOR"
            set {checked::%player%} to "CHECKED"
            send "&7You have selected your age as a &cSenior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &cSenior&7." to loop-player
                    close player's inventory


on inventory close:
    if {checking::%player%} = true:
        cancel event

#The part im having issues with


command /age [<player>]:
    permission: helper
    trigger:
        send "&4&lVelvetSurv>> &c%arg-1%&c is registered as a %{agestatus::%arg-1%}%"
command /agechange:
    trigger:
        open chest with 3 rows named "&7Pick your &bage&7:" to player
        format gui slot 11 of player with green wool named "&aJunior" to run:
            set {agestatus::%player%} to "&a&lJUNIOR"
            send "&7You have selected your age as a &aJunior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &aJunior&7." to loop-player
                    close player's inventory
                
        format gui slot 15 of player with red wool named "&cSenior" to run:
            set {agestatus::%player%} to "&4&lSENIOR"
            send "&7You have selected your age as a &cSenior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &cSenior&7." to loop-player
                    close player's inventory

Link to comment
Share on other sites

On 9/2/2021 at 12:08 AM, nolando09 said:

When players join they just close their inv and walk off and because it wont tell me their age (because they didnt pick) i dont know what area they are allowed in 😞 please someone help me with this

 

CODE:

 

on join:
    if {checked::%player%} is not set:
        set {checking::%player%} to "true"
        open chest with 3 rows named "&7Pick your &bage&7:" to player
        format gui slot 11 of player with green wool named "&aJunior" to run:
            set {agestatus::%player%} to "&a&lJUNIOR"
            set {checked::%player%} to "CHECKED"
            send "&7You have selected your age as a &aJunior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &aJunior&7." to loop-player
                    close player's inventory
                    
        format gui slot 15 of player with red wool named "&cSenior" to run:
            set {agestatus::%player%} to "&4&lSENIOR"
            set {checked::%player%} to "CHECKED"
            send "&7You have selected your age as a &cSenior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &cSenior&7." to loop-player
                    close player's inventory


on inventory close:
    if {checking::%player%} = true:
        cancel event

#The part im having issues with


command /age [<player>]:
    permission: helper
    trigger:
        send "&4&lVelvetSurv>> &c%arg-1%&c is registered as a %{agestatus::%arg-1%}%"
command /agechange:
    trigger:
        open chest with 3 rows named "&7Pick your &bage&7:" to player
        format gui slot 11 of player with green wool named "&aJunior" to run:
            set {agestatus::%player%} to "&a&lJUNIOR"
            send "&7You have selected your age as a &aJunior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &aJunior&7." to loop-player
                    close player's inventory
                
        format gui slot 15 of player with red wool named "&cSenior" to run:
            set {agestatus::%player%} to "&4&lSENIOR"
            send "&7You have selected your age as a &cSenior&7! Do /agechange to correct any issues with your age status." to player
            loop all players:
                if loop-player has permission "helper":
                    send "&7(&8!&7) &cAge Alert &7(&8!&7) &b%player% &7has registered as a &cSenior&7." to loop-player
                    close player's inventory

You can't cancel the Inventory Close Event as it's client side, the event is just the client notifying the server that the inventory is being closed. You would have to let it close then reopen it a tick or two later.

Developer

 

Joined Minecraft in 2010 on PC

Joined Minehut in August 2016

1 year Skript experience

2 months Java experience

5 months Javascript experience

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...