Jump to content

i need a /grant skript. Because the plugin sadly does not work.


pixachuu

Recommended Posts

You probably want to give more details such as what ranks you want to be able to grant, what skript addons you have, and what permission plugin you use. That would help the person making it to actually make it. 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

This code might work.

command /grant [<player>]:
 permission: command.grant
 permission message: Hey bozo! You can't use this!
 trigger:
   if arg-player is not set:
     send "&cYou need to select a player!"
   if arg-player is set:
    open virtual chest inventory with size 3 named "&6&lGrant Ranks" to player
    format gui slot 10 of player with green wool named "&2&lVIP" to run:
     execute console command "/lp user %arg-player% parent add vip"
        

You do need to customize it but I'd say its simple enough to replicate. 

  • Like 1
Link to comment
Share on other sites

@Syph arg-player does not exist. You will need to say arg-1. Also, the code you sent fits more with SkQuery than it does with TuSKe.

Try something like this for using TuSKe:

command /grant [<player>]:
 permission: command.grant
 permission message: No perms.
 trigger:
   if arg-1 is not set:
     send "&cYou need to select a player!"
   if arg-1 is set:
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with green wool named "&2&lVIP"
      format gui slot 11 with blue wool named "&b&lMVP"
    open last gui to player

on inventory click:
  inventory name of current inventory of player is "&6&lGrant Ranks":
    cancel event
    clicked slot is 10:
      make console execute command "/lp user %player% parent add vip"
    clicked slot is 11:
      make console execute command "/lp user %player% parent add mvp"

 

  • Like 1

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

3 minutes ago, BanditEagle said:

@Syph arg-player does not exist. You will need to say arg-1. Also, the code you sent fits more with SkQuery than it does with TuSKe.

Try something like this for using TuSKe:


command /grant [<player>]:
 permission: command.grant
 permission message: No perms.
 trigger:
   if arg-1 is not set:
     send "&cYou need to select a player!"
   if arg-1 is set:
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with green wool named "&2&lVIP"
      format gui slot 11 with blue wool named "&b&lMVP"
    open last gui to player

on inventory click:
  inventory name of current inventory of player is "&6&lGrant Ranks":
    cancel event
    clicked slot is 10:
      make console execute command "/lp user %player% parent add vip"
    clicked slot is 11:
      make console execute command "/lp user %player% parent add mvp"

 

arg-player takes the "[<player>] bit in the command, might just be the addons I use. arg-1 doesnt work for me

  • Like 1
Link to comment
Share on other sites

I've never seen arg-player before.. perhaps it is related to an addon. Just curious, what addons do you have?

Also, it is a bit odd that arg-1 doesn't work. But idk

  • Like 1

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

1 minute ago, BanditEagle said:

I've never seen arg-player before.. perhaps it is related to an addon. Just curious, what addons do you have?

Also, it is a bit odd that arg-1 doesn't work. But idk

These are the Skript Addons I use on my server.

image.png.b8651b8d6248eb96dded902fd0067929.png

  • Like 1
Link to comment
Share on other sites

I don't have json, tablisknu, and skvault on mine.. most likely one of those gives that feature, probably skript-json does. Good to know, thanks!

  • Like 1

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

Thank you guys SO much, this is really needed. Ill just look at this when im making an interactive gui. Thanks alot! Yall are the best! May you be blessed with good luck. ❤️ And dont worry about confirmation messages. I can do that part, but thanks again!

Link to comment
Share on other sites

22 hours ago, BanditEagle said:

I've never seen arg-player before.. perhaps it is related to an addon. Just curious, what addons do you have?

Also, it is a bit odd that arg-1 doesn't work. But idk

arg-player is a vanilla thing. But not sure why just arg-1 is not working for them. There shouldn't be any addons that interfere with that. 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

4 minutes ago, _Tarna_ said:

arg-player is a vanilla thing. But not sure why just arg-1 is not working for them. There shouldn't be any addons that interfere with that. 

arg-player is vanilla? What why have I never heard of arg-player ever before??? I mean, I got used to just using arg-[x] on whatever argument i set the player to, so it might take a while to adapt, but idk if i want to tbh it just kinda makes sense to me to have it like arg-1, arg-2, etc.

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

Just now, pixachuu said:

I started an enire conversation 0-0

 

hahaha ytou did!!

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

19 minutes ago, BanditEagle said:

arg-player is vanilla? What why have I never heard of arg-player ever before??? I mean, I got used to just using arg-[x] on whatever argument i set the player to, so it might take a while to adapt, but idk if i want to tbh it just kinda makes sense to me to have it like arg-1, arg-2, etc.

Ya I have also just been used to using arg-[x]. I didn't even know you can do things like arg-player till months after I disconvered skripts.

All the following are valid things you can use to reference args in skript
 

the last argument
arg-1
argument 6
13th arguments
the argument
the player argument
arg-item type-3

you can even do things like arg-item and arg-integer, not just arg-player. 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

command /grant [<player>]:
 permission: command.grant
 permission message: No perms.
 trigger:
   if arg-1 is not set:
     send "&cYou need to select a player!"
   if arg-1 is set:
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with green wool named "&2&lVIP"
      format gui slot 11 with blue wool named "&b&lMVP"
    open last gui to player

on inventory click:
  inventory name of current inventory of player is "&6&lGrant Ranks":
    cancel event
    clicked slot is 10:
      close
      create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with red wool named "&c30m"
      format gui slot 11 with blue wool named "&e1h"
      format gui slot 12 with lime wool named "&a24h"
      format gui slot 13 with blue wool named "&5Perm"
    clicked slot is 10:
      close
      send "&aSucsessfuly granted %arg-1% vip!
      make console execute /lp user %arg-1% parent set vip
      wait 1800 seconds
      send "&7%arg-1%'s rank has expired. Use /grant to grant them more time!"
      make console execute /lp user %arg-1% parent set default
      
      

 

Link to comment
Share on other sites

oops messed up give me a sec

command /grant [<player>]:
 permission: command.grant
 permission message: No perms.
 trigger:
   if arg-1 is not set:
     send "&cYou need to select a player!"
   if arg-1 is set:
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with green wool named "&2&lVIP"
      format gui slot 11 with blue wool named "&1&lMVP"
      format gui slot 12 with yellow wool named "&e&lElite"
      format gui slot 13 with light blue wool named "&b&lLegend"
      format gui slot 13 with purple wool "&5&lPro"
      format gui slot 14 with cookie named "&0&lO&f&lr&0&le&r&lo"
    open last gui to player

on inventory click:
  inventory name of current inventory of player is "&6&lGrant Ranks":
    cancel event
    clicked slot is 10:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with red wool named "&c30m"
      format gui slot 11 with blue wool named "&e1h"
      format gui slot 12 with lime wool named "&a24h"
      format gui slot 13 with purple wool named "&5Perm"
    open last gui to player
  
    clicked slot is 10:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% vip! to player
      make console execute /lp user %arg-1% parent set vip
      set {_grant::vip::%uuid of arg-1%} to 1800
    clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
    clicked slot is 11:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% vip! to player
      make console execute /lp user %arg-1% parent set vip
      set {_grant::vip::%uuid of arg-1%} to 3600
    stop
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
    clicked slot is 12:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% vip! to player
      make console execute /lp user %arg-1% parent set vip
      set {_grant::vip::%uuid of arg-1%} to 86400    
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
      clicked slot is 13:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% vip! to player
      make console execute /lp user %arg-1% parent set vip
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop

every 5 seconds:
  loop {_grant::vip::*}:
    remove 5 from {_grant::vip::*}
    if {_grant::vip::*} is >= 0:
      send "&7%loop-value%'s rank has expired. Use /grant to grant them more time!" to loop-player where [input has permission "command.grant"]
      make console execute /lp user %loop-value% parent set default
    stop
    
      clicked slot is 11:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with red wool named "&c30m"
      format gui slot 11 with blue wool named "&e1h"
      format gui slot 12 with lime wool named "&a24h"
      format gui slot 13 with purple wool named "&5Perm"
    open last gui to player
  
    clicked slot is 10:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% mvp! to player
      make console execute /lp user %arg-1% parent set mvp
      set {_grant::mvp::%uuid of arg-1%} to 1800
    clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
    clicked slot is 11:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% mvp! to player
      make console execute /lp user %arg-1% parent set mvp
      set {_grant::mvp::%uuid of arg-1%} to 3600
    stop
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
    clicked slot is 12:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% mvp! to player
      make console execute /lp user %arg-1% parent set mvp
      set {_grant::mvp::%uuid of arg-1%} to 86400    
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
      clicked slot is 13:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% mvp! to player
      make console execute /lp user %arg-1% parent set mvp
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop

every 5 seconds:
  loop {_grant::mvp::*}:
    remove 5 from {_grant::mvp::*}
    if {_grant::mvp::*} is >= 0:
      send "&7%loop-value%'s rank has expired. Use /grant to grant them more time!" to loop-player where [input has permission "command.grant"]
      make console execute /lp user %loop-value% parent set default
    stop
  
      clicked slot is 12:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 10 with red wool named "&c30m"
      format gui slot 11 with blue wool named "&e1h"
      format gui slot 12 with lime wool named "&a24h"
      format gui slot 13 with purple wool named "&5Perm"
    open last gui to player
  
    clicked slot is 10:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% Elite!" to player
      make console execute /lp user %arg-1% parent set elite
      set {_grant::elite::%uuid of arg-1%} to 1800
    clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
    clicked slot is 11:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% Elite!" to player
      make console execute /lp user %arg-1% parent set elite
      set {_grant::elite::%uuid of arg-1%} to 3600
    stop
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
    clicked slot is 12:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% Elite!" to player
      make console execute /lp user %arg-1% parent set elite
      set {_grant::elite::%uuid of arg-1%} to 86400    
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop
  
      clicked slot is 13:
      close
    create a gui with virtual chest inventory named "&6&lGrant Ranks" with 3 rows:
      format gui slot 13 with red wool named "&cCancel"
      format gui slot 15 with green wool named "&aConfirm"
    open last gui to player
     clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% Elite!" to player
      make console execute /lp user %arg-1% parent set elite
      clicked spot is 13:
      close
      send "&4Caneled grant." to player
    stop

every 5 seconds:
  loop {_grant::elite::*}:
    remove 5 from {_grant::elite::*}
    if {_grant::elite::*} is >= 0:
      send "&7%loop-value%'s rank has expired. Use /grant to grant them more time!" to loop-player where [input has permission "command.grant"]
      make console execute /lp user %loop-value% parent set default
    stop
  

If you want it dm me on discord idkwhattoputhere#4237

Edited by pixachuu
Added ELite grant
Link to comment
Share on other sites

1 hour ago, _Tarna_ said:

Ya I have also just been used to using arg-[x]. I didn't even know you can do things like arg-player till months after I disconvered skripts.

All the following are valid things you can use to reference args in skript
 


the last argument
arg-1
argument 6
13th arguments
the argument
the player argument
arg-item type-3

you can even do things like arg-item and arg-integer, not just arg-player. 

why have i never heard of this wtf why was i only introduced to arg-[x]??? Im saving this things u said lol

uhh @pixachuu, just an fyi, if you do it like this, the skript will run for that amount of time before it continues onto the next line. This means that your server would essentially be frozen for 1800 seconds  before it starts to register things again, at which point the server would crash due to the long time of no response.

24 minutes ago, pixachuu said:

wait 1800 seconds


Instead, use something like this:

[stuff before with the gui n stuff]
    clicked spot is 15:
      close
      send "&aSuccessfuly granted %arg-1% vip! to player
      make console execute /lp user %arg-1% parent set vip
      set {_grant::vip::%uuid of arg-1%} to 1800

every 5 seconds:
  loop {_grant::vip::*}:
    remove 5 from {_grant::vip::*}
    if {_grant::vip::*} is >= 0:
      send "&7%loop-value%'s rank has expired. Use /grant to grant them more time!" to loop-player where [input has permission "command.grant"]
      make console execute /lp user %loop-value% parent set default
    
          
      

I will be real, i have extremely low hopes of this working out at all, especially the {_grant::vip::*} bits, but its a path I would follow

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

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