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

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved How to make doors

Discussion in 'Skript' started by DeadNside, Feb 10, 2021.

Tags:
Thread Status:
Not open for further replies.
  1. DeadNside

    DeadNside Member

    Joined:
    Feb 10, 2021
    Messages:
    4
    Likes Received:
    2
    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
     
  2. Best Answer:
    Post #2 by PatoFrango, Feb 10, 2021
  3. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    Sure is possible. Something like this maybe?
    Code (Text):
    1. on 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 42, 42, 42 in "world" to air
    8.         else:
    9.             # close door
    10.             delete {doorOpen}
    11.             set block at location at 42, 42, 42 in "world" to barrier
     
  4. DeadNside

    DeadNside Member

    Joined:
    Feb 10, 2021
    Messages:
    4
    Likes Received:
    2
    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
    --- Double Post Merged, Feb 10, 2021, Original Post Date: Feb 10, 2021 ---
    Wont work

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

    Attached Files:

    #3 DeadNside, Feb 10, 2021
    Last edited: Feb 10, 2021
    PatoFrango likes this.
  5. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    Nice. Don't forget to delete that variable if you're not going to use it.
     
  6. DeadNside

    DeadNside Member

    Joined:
    Feb 10, 2021
    Messages:
    4
    Likes Received:
    2
    This is the end result thank you
     

    Attached Files:

  7. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    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 (Text):
    1. set {doorOpen::castleDoor} to true
    2. set {doorOpen::backDoor} to true
    3. 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.
     
  8. DeadNside

    DeadNside Member

    Joined:
    Feb 10, 2021
    Messages:
    4
    Likes Received:
    2
    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.
     
    PatoFrango likes this.
Thread Status:
Not open for further replies.

Share This Page

Loading...