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

Merge branch 'feature/half-players-sleep' into develop

# Conflicts:
#	RC-PotatoEssentials.sk
parents a22902d3 cf8582d9
......@@ -1180,6 +1180,7 @@ on quit:
clear {re.%player%.current.minute}
clear {re.%player%.current.second}
clear {pwhisper.%player%}
remove player from {pe.sleep::*}
on server ping:
set the motd to "&eRammyCraft RP &9v1.15.2-1 &6https://www.rammycraft.pw"
......@@ -1208,3 +1209,29 @@ on join:
# message "&eScheduled Maintenance"
# message "&eDate: 6 September 2019"
# message "&eTime: 6 PM - 630 PM (30 minutes)"
on bed enter:
set {_numofplayersreq} to rounded down online player count / 10 * 7
# Add player to count for messages
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::*}
set {_currentSleepingCount} to size of {_playersAsleep::*}
if {_currentSleepingCount} is more than or equal to {_numofplayersreq}:
set time to 06:00
set weather to sunny
stop
on bed leave:
remove player from {pe.sleep::*}
set {_numofplayersreq} to rounded down online player count / 10 * 7
# Only message if its thunderstorm or night time
if is thundering:
broadcast formatted "&e%player% &6is now awake. &b%size of {pe.sleep::*}% &6out of &b%{_numofplayersreq}% &6required players are asleep."
else if time is not between 06:00 and 06:30:
broadcast formatted "&e%player% &6is now awake. &b%size of {pe.sleep::*}% &6out of &b%{_numofplayersreq}% &6required players are asleep."
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