Verse Library verse

01 Fragment

Opens and closes saloon doors by rotating mesh children when players enter or leave.

verse-library/using-western-prefabs-in-fortnite-creative/01-fragment.verse

# This script makes the Saloon doors open automatically.

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

# This is our main Saloon device.
# It holds all the parts of the building.
saloon_device := script()

# This function runs when a player walks near.
# 'player' is the person who got close.
on Player_Detected := (player : Player) -> unit:
    # Find the left door by its name.
    # We look inside the Saloon device.
    left_door := saloon_device.FindChild("Door_Left")
    
    # Find the right door by its name.
    right_door := saloon_device.FindChild("Door_Right")
    
    # Open the left door.
    # We tell it to rotate 90 degrees.
    left_door.SetRotation(0, 0, 90)
    
    # Open the right door.
    # We tell it to rotate -90 degrees.
    right_door.SetRotation(0, 0, -90)

# This function runs when a player walks away.
# It closes the doors.
on Player_Away := () -> unit:

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