Discord Thread Rent System

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

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,755
1
0
The skUnity Discord
discord.gg
Can someone help me with the rent system I'm currently working on? I can look and unlock the door as I want, but how can I do that just 1 Player can rent it?

options:
prefix: "&6&lHaus&7&o»"

on join:
set {gemietet::%player's uuid%} to false
set {gemietet} to false
on rightclick:
if player is sneaking:
if "%event-block%" contains "dark oak":
if {gemietet} is false:
cancel event
open chest with 6 rows named "--- Haus ---" to player
set slot 13 of player's current inventory to nametag named "Haus mieten"
else:
if player has permission "hausbesitzer":
cancel event
open chest with 6 rows named "--- Dein Haus ---" to player
if {aufgeschlossen::%player's uuid%} is false:
set slot 13 of player's current inventory to nametag named "aufschließen"
else:
set slot 13 of player's current inventory to nametag named "abschließen"
else:
cancel event
send "Du hast keinen Schlüssel für das Haus!" to player

on inventory click:
if name of event-inventory is "--- Haus ---":
if clicked slot is 13:
cancel event
set {gemietet} to true
set {gemietet::%player's uuid%} to true
close player's inventory

if name of event-inventory is "--- Dein Haus ---":
if clicked slot is 13:
if player has permission "hausaufschliessen":
set {aufgeschlossen::%player's uuid%} to !{aufgeschlossen::%player's uuid%}
cancel event
close player's inventory
else:
send "Du hast keinen Schlüssel für das Haus!" to player
cancel event

on rightclick:
if "%event-block%" contains "dark oak":
if {aufgeschlossen::%player's uuid%} is true:
else:
cancel event

Posted by: maxbdm from the skUnity Discord. View the thread on skUnity Discord here
 
code_language.skript:
options:
  prefix: "&6&lHaus&7&o»"

on join:
  set {gemietet::%player's uuid%} to false
  set {gemietet} to false
on rightclick:
  if player is sneaking:
    if "%event-block%" contains "dark oak":
      if {gemietet} is false:
        cancel event
        open chest with 6 rows named "--- Haus ---" to player
        set slot 13 of player's current inventory to nametag named "Haus mieten"
      else:
        if player has permission "hausbesitzer":
          cancel event
          open chest with 6 rows named "--- Dein Haus ---" to player
          if {aufgeschlossen::%player's uuid%} is false:
            set slot 13 of player's current inventory to nametag named "aufschließen"
          else:
            set slot 13 of player's current inventory to nametag named "abschließen"
        else:
          cancel event
          send "Du hast keinen Schlüssel für das Haus!" to player

on inventory click:
  if name of event-inventory is "--- Haus ---":
    if clicked slot is 13:
      cancel event
      set {gemietet} to true 
       set {gemietet::%player's uuid%} to true
      close player's inventory

  if name of event-inventory is "--- Dein Haus ---":
    if clicked slot is 13:
      if player has permission "hausaufschliessen":
        set {aufgeschlossen::%player's uuid%} to !{aufgeschlossen::%player's uuid%}
        cancel event
        close player's inventory
      else:
        send "Du hast keinen Schlüssel für das Haus!" to player
        cancel event

on rightclick:
  if "%event-block%" contains "dark oak":
    if {aufgeschlossen::%player's uuid%} is true:
    else:
      cancel event
options:
  prefix: "&6&lHaus&7&o»"

on join:
  set {gemietet::%player's uuid%} to false
  set {gemietet} to false
on rightclick:
  if player is sneaking:
    if "%event-block%" contains "dark oak":
      if {gemietet} is false:
        cancel event
        open chest with 6 rows named "--- Haus ---" to player
        set slot 13 of player's current inventory to nametag named "Haus mieten"
      else:
        if player has permission "hausbesitzer":
          cancel event
          open chest with 6 rows named "--- Dein Haus ---" to player
          if {aufgeschlossen::%player's uuid%} is false:
            set slot 13 of player's current inventory to nametag named "aufschließen"
          else:
            set slot 13 of player's current inventory to nametag named "abschließen"
        else:
          cancel event
          send "Du hast keinen Schlüssel für das Haus!" to player

on inventory click:
  if name of event-inventory is "--- Haus ---":
    if clicked slot is 13:
      cancel event
      set {gemietet} to true 
       set {gemietet::%player's uuid%} to true
      close player's inventory

  if name of event-inventory is "--- Dein Haus ---":
    if clicked slot is 13:
      if player has permission "hausaufschliessen":
        set {aufgeschlossen::%player's uuid%} to !{aufgeschlossen::%player's uuid%}
        cancel event
        close player's inventory
      else:
        send "Du hast keinen Schlüssel für das Haus!" to player
        cancel event

on rightclick:
  if "%event-block%" contains "dark oak":
    if {aufgeschlossen::%player's uuid%} is true:
    else:
      cancel event

Posted by: maxbdm from the skUnity Discord.
 
no only the warning Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (mietsystem.sk, line 46: if {aufgeschlossen::%player's uuid%} is true:')

Posted by: maxbdm from the skUnity Discord.
 
where in the code do you want to put it? after clicking on dark oak?
code_language.skript:
options:
  prefix: "&6&lHaus&7&o»"

on join:
  set {gemietet::%player's uuid%} to false
  set {gemietet} to false
on right click:
  type of clicked block is dark oak  
  if player is not sneaking:
    if {aufgeschlossen::%player's uuid%} is true:
      stop
    else:
      cancel event
  else:
    if {gemietet} is false:
      cancel event
      set {_} to chest inventory with 6 rows named "--- Haus ---"
      set slot 13 of {_} to nametag named "Haus mieten"
      open {_} to player
    else:
      if player has permission "hausbesitzer":
        cancel event
        set {_} to chest with 6 rows named "--- Dein Haus ---"
        if {aufgeschlossen::%player's uuid%} is false:
          set slot 13 of {_} to nametag named "aufschließen"
        else:
          set slot 13 of {_} to nametag named "abschließen"
        open {_} to player
      else:
        cancel event
        send "Du hast keinen Schlüssel für das Haus!" to player

on inventory click:
  event-inventory is not player's inventory
  click type is left mouse button
  if name of event-inventory is "--- Haus ---":
    cancel event
    if clicked slot is 13:
      set {gemietet} to true 
      set {gemietet::%player's uuid%} to true
      close player's inventory
  if name of event-inventory is "--- Dein Haus ---":
    if clicked slot is 13:
      if player has permission "hausaufschliessen":
        set {aufgeschlossen::%player's uuid%} to !{aufgeschlossen::%player's uuid%}
        close player's inventory
      else:
        send "Du hast keinen Schlüssel für das Haus!" to player
        cancel event
i little upgraded your code
you want command on this homes or after click on dark oak

Posted by: _grifin_ from the skUnity Discord.
 
It should be a system where you can like rent a house the code now works so that if you do shift+ rightclick on the door you can rent it and then close and open the door for other people (aufschliessen, abschliessen)
And know my question is how i could define single houses and not all dark oak doors together

Posted by: maxbdm from the skUnity Discord.
 
Status
Not open for further replies.