# LocalScript

LocalScript : `BaseScript`

## Overview

A LocalScript is an instance used to run client-side code

When the Enabled property is set to true and the client-side script is placed in StarterPlayerScripts, StarterCharacterScripts, or StarterGui, it will run in a new thread.

A running script continues to run unless it is explicitly stopped or encounters a critical error. Errors that occur inside functions connected to events do not stop the script from running.

If the script itself or any of its ancestor Objects is fully removed using Destroy(), the script stops running. However, if the script's Parent is set to nil but the Object remains in memory, the script will continue to run.

Since this script runs on each player's device (local environment), it's used to control client-only features like the Camera, UserInputService, or PlayerGui, as well as to manage UI interactions.

You can also access the player Object running the client directly using the game.Players.LocalPlayer property. This allows you to create behaviors based on the player's screen state or input.

## Properties

## Methods

## Events


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/localscript.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
