using { /Fortnite.com/Devices } using { /Fortnite.com/Game } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This script controls the bridge bridge_script := class(creative_device): # This is the Button device linked in the editor Details panel @editable Button : button_device = button_device{} # This is the prop device representing the "Ghost" bridge placed in the editor # Use a 'prop_manipulator_device' to show/hide a placed prop @editable GhostBridge : prop_manipulator_device = prop_manipulator_device{} # This is the function that runs when the game starts OnBegin(): void = # Subscribe to the button's InteractedWithEvent so we react when pressed Button.InteractedWithEvent.Subscribe(OnButtonPressed) # This runs when the button is pressed # agent is the player who pressed the button OnButtonPressed(Agent : agent): void = # Show the bridge prop and re-enable its collision GhostBridge.Enable() # Wait 5 seconds, then hide the bridge again # Remove the two lines below if you want the bridge to stay forever spawn { WaitAndHide() } WaitAndHide(): void = Sleep(5.0) GhostBridge.Disable()