Jump to content
  • 0

Skripting a gui.


Audehh08

Question

Hi!! So I have a gui shop using skript. this is the skript:


```
command /ts:
trigger:
open virtual chest inventory with size 3 named "&c&lToken Shop" to player
format gui slot 1 of player with shiny diamond named "&4&lVIP Rank" with lore "&fCost: 100 tokens" to run:
if balance of player >= 100:
remove 100 from balance of player
execute console command "lp user %player% parent set vip"
```


As you can see you can buy a rank on my server. but how do i cancel the event if they player already has bought vip??

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Just check the user's current rank and see if its already been bought. You can use player's group to check for a player's group. 

Discord - tarna256

In-game name - _Tarna_

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

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

[VIP] - 7/27/2020

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

  • 0
2 minutes ago, Audehh08 said:

Yes but this is a gui rank shop and if someone buys it it takes 100 coins. but if they have already purchased it and they click buy vip again, it charges them again

Yes like I said, check for their rank.

if player's group is "VIP":
	# check for balance and give them rank
else:
	send "You have already purchased VIP"

 

Discord - tarna256

In-game name - _Tarna_

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

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

[VIP] - 7/27/2020

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

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