Kick a person out of bed

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

Mads

Member
Feb 5, 2017
4
0
1
25
Does anyone have a good idea on how to kick a person from the bed?

So far, i do it by damaging the player and giving back the players health immediately but i hope there is a better way
 
It's a simple 2 line of code.

Nobody can enter no matter what.
code_language.skript:
on bed enter:
    cancel event

Players with permission "bed.bypass" will be able to sleep in beds.
code_language.skript:
on bed enter:
    if player has permission "bed.bypass":
        stop
    else:
        cancel event

Enjoy.
 
It's a simple 2 line of code.

Nobody can enter no matter what.
code_language.skript:
on bed enter:
    cancel event

Players with permission "bed.bypass" will be able to sleep in beds.
code_language.skript:
on bed enter:
    if player has permission "bed.bypass":
        stop
    else:
        cancel event

Enjoy.
He means removing a player from the bed when they are in the bed. Not preventing the player from going to bed.
 
  • bed enter:
  • if player has permission "bed.bypass":
  • stop
  • else:
  • cancel event
This is a really bad practice, just negate the condition:
code_language.skript:
on bed enter:
  if player doesn't have permission "whatever":
    cancel event

Regarding the issue, just break the bed and place it again or it will require packets.
 
Okay, so if packets is the way for now, I think damaging the player is ok for me:emoji_wink:
 
Status
Not open for further replies.