Custom Placeholder (Structure) — skript-placeholders

Addon: skript-placeholders · Category: Structure · Since: 1.0.0, 1.3.0 (MVdWPlaceholderAPI support), 1.7.0 (relational placeholder support)

Syntax

(placeholder[ ]api|papi) [relational] placeholder (with|for) [the] prefix %*string%

Description

A structure for creating custom placeholders. The code will be executed every time the placeholder plugin requests a value for the placeholder.

Examples

placeholderapi placeholder with the prefix "skriptplaceholders":
	if the identifier is "author": # Placeholder is "%skriptplaceholders_author%"
		set the result to "APickledWalrus"
placeholderapi relational placeholder with the prefix "skriptplaceholders":
	if the identifier is "longer_name": # Placeholder is "%rel_skriptplaceholders_longer_name%"
		if the length of the name of the first player > the length of the name of the second player:
			set the result to the name of the first player
		else:
			set the result to the name of the second player
mvdw placeholder named "skriptplaceholders_author":
	# Placeholder is "{skriptplaceholders_author}"
	set the result to "APickledWalrus"

View source