using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
reward_station := class(creative_device):
@editable
RewardButton : button_device = button_device{}
@editable
PrizeGranter : item_granter_device = item_granter_device{}
@editable
RoundTimer : timer_device = timer_device{}
OnBegin<override>()<suspends> : void =
RewardButton.InteractedWithEvent.Subscribe(OnRewardPressed)
OnRewardPressed(Player : agent) : void =
PrizeGranter.GrantItem(Player)
RoundTimer.SetActiveDuration(30.0)
RoundTimer.Start()
Print("Reward granted — round is on!")
Verse Library
verse
04 Device
Connects a button, item granter, and timer to automatically grant rewards and start a round when pressed.
verse-library/verse-devices-common-devices/04-device.verse