# This is a simple Verse script for a Ball Spawner
# We create a function that runs when the game starts
OnBegin<override>()<suspends>: void=
# This line spawns the ball at the start
SpawnBall()
# This function creates the ball
SpawnBall(): void=
# We tell the game to create a ball object
# The ball will appear where the device is placed
CreateBall()
# This function handles what happens when the ball hits the goal
OnBallEnterGoal<override>()<suspends>: void=
# We add one point to the score
AddPoint(1)
Verse Library
verse
01 Fragment
Initializes ball objects and handles goal-based scoring logic.
verse-library/using-ball-spawner-devices-in-fortnite-creative/01-fragment.verse