Verse Library verse

01 Fragment

Heals players up to one hundred health when they step on a trigger zone.

verse-library/using-healing-consumables-in-fortnite-creative/01-fragment.verse

# This is our script for the healing trigger.
using { /Fortnite.com/Devices }

# We create a new script type.
# Think of this as the blueprint for our magic floor.
healing_floor_script := script() {
	
	# This event happens when a player enters the trigger.
	OnPlayerBeginOverlap := event(player : player) {
		
		# We get the player's current health.
		# It is like checking the water level in the tank.
		current_health := player.GetHealth()
		
		# We decide how much to heal.
		# Let's add 20 points.
		heal_amount := 20
		
		# We add the heal amount to the current health.
		new_health := current_health + heal_amount
		
		# We cap the health at 100.
		# You can't have more than 100 health!
		if (new_health > 100) {
			new_health = 100
		}
		
		# We set the new health on the player.
		player.SetHealth(new_health)

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