Commit ab5f77c9 authored by Tommy Ang's avatar Tommy Ang 🤣

Fix majority vote to work only in worlds

parent 5e3f1812
......@@ -1213,13 +1213,15 @@ on join:
on bed enter:
set {_numofplayersreq} to rounded down online player count / 10 * 7
# Add player to count for messages
player is in world "world"
add player to {pe.sleep::*}
broadcast formatted "&e%player% &6is now sleeping. &b%size of {pe.sleep::*}% &6out of &b%{_numofplayersreq}% &6required players are asleep."
wait 4 seconds
loop all players:
# Rely on sleeping status for more accurate reporting
if loop-player is sleeping:
add loop-player to {_playersAsleep::*}
loop-player is in world "world"
loop-player is sleeping
add loop-player to {_playersAsleep::*}
set {_currentSleepingCount} to size of {_playersAsleep::*}
if {_currentSleepingCount} is more than or equal to {_numofplayersreq}:
set time to 06:00
......@@ -1227,6 +1229,7 @@ on bed enter:
stop
on bed leave:
player is in world "world"
remove player from {pe.sleep::*}
set {_numofplayersreq} to rounded down online player count / 10 * 7
# Only message if its thunderstorm or night time
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment