Solved How to make doors

  • 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 comminuty!

    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.

DeadNside

Member
Feb 10, 2021
4
2
3
18
I want to make doors with custom keys that you can only use if you have the perm How would i got about doing that? If you don't understand i want to remove blocks in a certain cord on a right click with a item than right click again to replace it I'm not sure if this is even possible but if it is please tell me
 
Sure is possible. Something like this maybe?
Code:
on rightclick with gold nugget:
    # if the player has said permission
    if player has permission "keymaster":
        if {doorOpen} is not set:
            # open door
            set {doorOpen} to true
            set block at location at 42, 42, 42 in "world" to air
        else:
            # close door
            delete {doorOpen}
            set block at location at 42, 42, 42 in "world" to barrier
 
1on rightclick with gold nugget:
2 # if the player has said permission
3 if player has permission "keymaster":
4 if {doorOpen} is not set:
5 # open door
6 set {doorOpen} to true
7 set block at location at 460, 58, -238, in "world" to air
8 else: # close door
9 delete {doorOpen}
10 set block at location at 460, 58, -238, in "world" to oak plank
[doublepost=1612979185,1612978996][/doublepost]Wont work

I was able to fix it it was my bad your code worked wonders
 

Attachments

  • Screenshot 2021-02-10 103640.png
    Screenshot 2021-02-10 103640.png
    47.5 KB · Views: 135
Last edited:
  • Like
Reactions: PatoFrango
This is the end result thank you
 

Attachments

  • Screenshot 2021-02-10 111603.png
    Screenshot 2021-02-10 111603.png
    52.5 KB · Views: 145
Cool. A few tips:
  • If you're going to make bigger doors, use loops instead of writing a line for each block;
  • You should probably organize all doors in list variables. For example
Code:
set {doorOpen::castleDoor} to true
set {doorOpen::backDoor} to true
set {doorOpen::houseDoor} to true
So that you can better manage them in the future. Also, be sure to assign those variables to player UUID's if you're managing doors per player.
 
Yeah im still really new to this, So i have alot to learn thanks for teaching me this. Im also not sure about the variables they dont make much sence to me but ill do my best to figure it out. Looks really help ful.
 
  • Like
Reactions: PatoFrango
Status
Not open for further replies.