# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/basics-of-writing-code-9-practice-time-in-verse
# Local doc: epic-docs/documentation/en-us/fortnite/basics-of-writing-code-9-practice-time-in-verse.md
# Section: Complete Script
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Playspaces }
using { /UnrealEngine.com/Temporary/SpatialMath }
hello_world_device := class(creative_device):
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Playspace:fort_playspace = GetPlayspace()
AllPlayers:[]player = Playspace.GetPlayers()
var FirstPosition:transform = transform{}
var SecondPosition:transform = transform{}
if:
Player:player = AllPlayers[0]
FortniteCharacter:fort_character = Player.GetFortCharacter[]
set FirstPosition = FortniteCharacter.GetTransform()
then:
Print("Move or prepare to take damage!")
Sleep(10.0)
if:
Player : player = AllPlayers[0]
FortniteCharacter : fort_character = Player.GetFortCharacter[]
set SecondPosition = FortniteCharacter.GetTransform()
DistanceBetweenPositions: float = DistanceXY(FirstPosition.Translation, SecondPosition.Translation)
DistanceBetweenPositions < 10000.0
then:
Verse Library
verse
02 Complete Script
Monitors player movement over time and applies damage if displacement is below a threshold.
extracted-snippets/documentation/en-us/fortnite/basics-of-writing-code-9-practice-time-in-verse/02-complete-script.verse
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.