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.

PLEASE HELP

Discussion in 'Skript' started by Endas, Jun 22, 2020.

Thread Status:
Not open for further replies.
  1. Endas

    Endas Member

    Joined:
    Jun 22, 2020
    Messages:
    10
    Likes Received:
    0
    Hello, i need help with this:

    on place of a GOLD BLOCK:
    message "Spawnpoint set"
    make player execute command "/spawnpoint %player%"

    I want to make spawnpint on top of the gold block
    How to do it?

    And if gold block destroyed, spawnpoint removed.
     
  2. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    228
    Likes Received:
    9
    Code (Text):
    1.  
    2. on place:
    3.     if event-block is gold block:
    4.         set {spawnpoint.%player%} to location above event-block
    5.         send "&aSpawnpoint set."
    6.         stop
    7.  
    8. on break:
    9.     if event-block is gold block:
    10.         #if location above event-block is {spawnpoint.%player%}:
    11.         delete {spawnpoint.%player%}
    12.         send "&cSpawnpoint removed."
    13.         stop
     
  3. Endas

    Endas Member

    Joined:
    Jun 22, 2020
    Messages:
    10
    Likes Received:
    0
    I placed gold block, and killer my self, but spawnpoint not working. But no errors
     
  4. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    228
    Likes Received:
    9
    b: https://gyazo.com/aedf0ec3f8bf024cf72535b0e32e33aa

    on death event: https://gyazo.com/6d9b2a14c5ed692636e8a5d63edd73a2

    Code (Text):
    1. on place:
    2.     if event-block is gold block:
    3.         set {spawnpoint.%player%} to location above event-block
    4.         send "&aSpawnpoint set."
    5.         stop
    6.  
    7. on break:
    8.     if event-block is gold block:
    9.         if location above event-block is {spawnpoint.%player%}:
    10.             delete {spawnpoint.%player%}
    11.             send "&cSpawnpoint removed."
    12.             stop
    13.  
    14. on death of a player:
    15.     set death message to ""
    16.     set player's hunger to 10
    17.     heal player
    18.     teleport player to {spawnpoint.%player%}
    19.     stop
     
Thread Status:
Not open for further replies.

Share This Page

Loading...