Verse Library verse

02 Fragment

Triggers a day cycle change to midnight when a button is pressed.

verse-library/set-up-the-basic-devices/02-fragment.verse

using /Fortnite.com/Devices
using /Verse.org/Sim

# We declare the devices as "Properties" of this script.
# UEFN will let you drag-and-drop devices into these slots in the editor.
ChaosButton: Button = Button{}
SkyChanger: DaySequence = DaySequence{}

OnBegin() -> unit:
    # Connect the button press to our function
    ChaosButton.Pressed.Connect(ChangeTheSky)

ChangeTheSky() -> unit:
    # Change the time to Midnight
    SkyChanger.SetTimeOfDay(TimeOfDay::Midnight)
    
    # Play a sound effect (if you have one)
    # ChaosButton.PlaySound(SoundEffect::Explosion)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in