Scripting/Client/Functions/IncludeScript

Runs a client script of the caller's own script folder, for example IncludeScript("lazy/shop.nut"). Returns true when it ran and false when it had already run (force = true runs it again). Throws when the server did not send a script of that name, or when it has an error. Only scripts the server sent can be run: no disk files, no source text. Clients from before 2026-11-25 do not have it ("IncludeScript" in getroottable()).

Syntax

IncludeScript(name [, force])

Arguments

Example

function onScriptLoad()
{
	IncludeScript( "Example" );
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Looking up entities

Categories: Client functions | Looking up entities