Jump to content

Private door with key


mateiop4

Recommended Posts

Hello! I need help with a skript code. I am trying to make a mining server and i want to make player buy a key to unlock the next area. But there is a problem. Multiple people can go in the next area. I want it to be only for the player with the key. Sorry for my english. Hope someone will help me. Thank you! 😄

Link to comment
Share on other sites

3 hours ago, mateiop4 said:

Hello! I need help with a skript code. I am trying to make a mining server and i want to make player buy a key to unlock the next area. But there is a problem. Multiple people can go in the next area. I want it to be only for the player with the key. Sorry for my english. Hope someone will help me. Thank you! 😄

you can set a variable and add player's uuid to the variable, and when they try to enter a region, you can check to see if the player's uuid is included in the variable, and if it isn't, you can deny them.

Hope this helps!

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 hours ago, BanditEagle said:

you can set a variable and add player's uuid to the variable, and when they try to enter a region, you can check to see if the player's uuid is included in the variable, and if it isn't, you can deny them.

Hope this helps!

Thank you! But can you please give me an example? I am new and i am not very sure how to use variables and uuid's... 

Link to comment
Share on other sites

2 hours ago, mateiop4 said:

Thank you! But can you please give me an example? I am new and i am not very sure how to use variables and uuid's... 

Something like this should work in theory, but I didn't test it out. Also, keep in mind that you will need a supported regions plugin to be installed on your server for it to work.

on right click with prismarine shard:
	name of player's item is "Key 1"
	add player's uuid to {checkArea1::*}

on region enter:
	region is "Area1"
	if {checkArea1::*} contains player's uuid:
		send "yes"
	
	else:
		cancel event
		send "no"

Hope this helps!

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

15 hours ago, BanditEagle said:

Something like this should work in theory, but I didn't test it out. Also, keep in mind that you will need a supported regions plugin to be installed on your server for it to work.


on right click with prismarine shard:
	name of player's item is "Key 1"
	add player's uuid to {checkArea1::*}

on region enter:
	region is "Area1"
	if {checkArea1::*} contains player's uuid:
		send "yes"
	
	else:
		cancel event
		send "no"

Hope this helps!

THANK YOU SO MUCH!!

Link to comment
Share on other sites

24 minutes ago, mateiop4 said:

THANK YOU SO MUCH!!

No problem, happy to be able to help!

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

4 hours ago, BanditEagle said:

No problem, happy to be able to help!

Hey, now that i tried the code, it sends me this: Also, the code is down there too. Please help me. Ty :D.

Captură de ecran din 2021-05-12 la 21.12.42.png

Captură de ecran din 2021-05-12 la 21.13.40.png

Edited by mateiop4
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...