Verse Library verse

01 Fragment

Spawns a drivable vehicle when players enter the device area and randomly assigns a unique color to each car.

verse-library/using-nitro-drifter-spawner-devices-in-fortnite-creative/01-fragment.verse

# This is a Verse script for a Nitro Drifter Spawner.
# It makes a car appear when a player touches a trigger.

using { /Fortnite.com/Devices }

# We create a new "Device" named MyCarSpawner.
# This links our code to the device in the game world.
device MyCarSpawner : NitroDrifterSpawnerDevice = {
    # This is the "On Player Enters" event.
    # It fires when a player walks into the device.
    OnPlayerEnters := event (player: Player) -> () {
        
        # This line spawns the car!
        # The car appears at the device's location.
        SpawnVehicle(player)
        
        # Let's change the car's color!
        # We pick a random color from a list.
        # This makes every car look unique.
        SetColor(RandColor())
    }
}

# We need a helper function to get a random color.
# This keeps our main code clean and easy to read.
RandColor := () -> Color {
    # We pick a random number between 0 and 100.
    # Then we use that number to pick a color.
    # This is like rolling dice to pick a color!
    return Color {

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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