> For the complete documentation index, see [llms.txt](https://sl-scritps.gitbook.io/sl-scripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sl-scritps.gitbook.io/sl-scripts-documentation/products/sl-scene.md).

# SL Scene

## SL Scene

**Code:** SCN-01\
**Resource:** `sl_scene`\
**Version:** v1.1.12\
**Category:** RP Tool / Scene Text / World Context\
**Status:** Stable

**Structured tools for serious roleplay servers.**

***

### Overview

SL Scene is a scene text and world note system for FiveM roleplay servers.

It allows players, staff or admins to create visible scene information in the world, helping others understand what is happening in a location without requiring constant chat explanations.

The resource is designed for roleplay context, environmental storytelling and scene support.

***

### What is this script for?

SL Scene helps servers add readable context to the world.

It is useful for:

* Scene descriptions
* Environmental details
* Staff-created RP context
* Investigation scenes
* Event preparation
* Temporary world notes
* Persistent roleplay markers
* Business or location flavor
* Injury, damage or object descriptions
* Roleplay situations that need visible context

The main goal is simple:

```txt
A player or admin creates scene text.
Other players nearby can read it.
The world feels more understandable and alive.
```

***

### Roleplay Experience

SL Scene is designed around a clear IC idea:

```txt
Something happened in the world.
A scene text describes it.
Players nearby can react to that information.
```

Instead of explaining everything repeatedly in chat, the scene can stay visible in the world.

Examples:

```txt
“There are broken glass pieces on the floor.”
“A strong smell of gasoline is present here.”
“The door frame looks damaged.”
“A small handwritten note is attached to the wall.”
```

This helps players understand the environment and continue roleplay naturally.

***

### Player IC Usage

For players, SL Scene should feel like leaving or reading contextual information in the world.

Common player IC uses:

* Describe an object or detail
* Mark something left behind
* Add roleplay context to a scene
* Explain damage or evidence
* Leave a temporary note
* Help other players understand what their character can see
* Support investigation, medical, business or event RP

Normal player flow:

```txt
Open scene tool → write scene text → place it in the world → other players read it
```

Example IC lines:

```txt
“You can see scratches on the door.”
“There is a spilled coffee cup on the counter.”
“The area smells like smoke.”
“A note is taped under the table.”
```

The scene text should describe what characters can reasonably perceive. It should not be used to force actions, reveal hidden OOC information or control another player's character.

***

### Player / IC Flow

#### 1. The player opens the scene tool

Depending on configuration, the player may open SL Scene with a command or supported interaction.

Common command examples:

```txt
/scene
/scena
```

Check your configuration for the exact command.

***

#### 2. The player writes the scene text

The player writes a short description of what others should notice.

Good examples:

```txt
Broken glass is scattered near the entrance.
A small trail of mud leads toward the back room.
There is a faint smell of alcohol near the table.
```

Bad examples:

```txt
You are scared.
You know who did this.
Everyone must leave now.
The suspect was definitely John.
```

Scene text should describe the environment, not force conclusions.

***

#### 3. The player places the scene

The player confirms the scene location.

Depending on configuration, the scene may be:

```txt
temporary
persistent
visible only nearby
restricted by permissions
```

***

#### 4. Other players read the scene

Nearby players can see the text and use it as roleplay context.

Example:

```txt
“I notice the broken glass near the entrance.”
```

***

#### 5. The scene expires or is removed

Depending on configuration, a scene may expire automatically or be removed by the creator/admin.

This helps avoid clutter in the world.

***

### Admin / Owner IC Usage

For admins, owners and staff, SL Scene is useful for worldbuilding and event control.

Common admin/owner IC uses:

* Prepare an event scene
* Add visible context before players arrive
* Mark evidence in an investigation
* Describe damage after an event
* Add atmosphere to a location
* Support medical, police, civilian or business RP
* Create temporary world details
* Clean up old or incorrect scene texts

Example admin/event flow:

```txt
Choose location → create scene text → players arrive → scene supports RP → remove/expire when finished
```

Example event use:

```txt
Staff prepares a robbery aftermath.
They place scene texts near the door, counter and back room.
Police and civilians arrive and use the descriptions for roleplay.
```

For roleplay servers, this makes events easier to understand without staff having to explain every detail in chat.

***

### Admin / Owner Technical Flow

Admins and owners can use SL Scene to manage world text and keep the server clean.

Common admin actions may include:

* Create scene text
* Edit scene text
* Delete scene text
* Manage temporary scenes
* Manage persistent scenes
* Clean expired scenes
* Review scene data
* Configure permissions
* Configure draw distance
* Configure text style
* Configure database persistence
* Test restart behavior

Recommended admin checks:

```txt
1. Open the scene tool.
2. Create a test scene.
3. Confirm the scene appears in the correct location.
4. Check visibility distance.
5. Restart the resource.
6. Confirm persistent scenes reload if enabled.
7. Delete the test scene.
8. Check server console and F8 for errors.
```

***

### Example IC Scenarios

#### Investigation scene

Police arrive after a robbery and see scene text near the entrance.

```txt
“Broken glass is scattered across the floor.”
```

#### Medical roleplay

EMS arrives at a scene and sees contextual information.

```txt
“There are blood drops leading toward the sidewalk.”
```

#### Business roleplay

A business owner adds small environmental flavor.

```txt
“A fresh menu board is standing near the counter.”
```

#### Event setup

Staff prepares a public scene before players arrive.

```txt
“Several chairs have been arranged for the community meeting.”
```

#### Civilian scene

A player leaves a visible note.

```txt
“A folded paper note is tucked behind the flower pot.”
```

***

### What this resource is not

SL Scene is not intended to be a full mission builder, dispatch system or investigation system by itself.

It is focused on:

```txt
scene text
world notes
roleplay context
environmental descriptions
temporary or persistent visible information
```

For larger narrative systems, scenes can be combined with other tools such as event systems, investigation systems or rolmaker tools.

***

### Main Features

* World scene text system
* Temporary and/or persistent scene support depending on configuration
* Player-created scene descriptions
* Admin scene management
* Configurable visibility distance
* Configurable text style
* Configurable permissions
* Database persistence when enabled
* Expiry support for temporary scenes
* Edit/delete flow when allowed
* Command fallback
* Clean visual presentation
* ES/EN locale support
* Server-side validation
* Useful for events, investigations, businesses and daily RP

***

### Dependencies

#### Required

```txt
FiveM server
```

#### Recommended / Optional

```txt
oxmysql
ox_lib
QBCore
Qbox
ESX
Standalone mode
```

If persistence is enabled, database support may be required.

If the resource uses UI or menu helpers, `ox_lib` may be recommended depending on configuration.

***

### Installation Notes

1. Place the resource folder inside your server resources folder.

Example:

```txt
resources/[sl_scripts]/sl_scene
```

2. Make sure the folder name is:

```txt
sl_scene
```

3. Configure:

```txt
config.lua
custom.lua
locales/
```

4. If SQL is included and database mode is enabled, import:

```txt
sql/install.sql
```

or use automatic migrations if supported by your build.

5. Add the resource to your `server.cfg`.

Example:

```cfg
ensure oxmysql
ensure ox_lib

ensure sl_scene
```

If you are not using database persistence, configure standalone or non-persistent behavior in `config.lua`.

***

### How to Use

#### Basic Player Flow

1. The player opens the scene tool.
2. The player writes a short scene description.
3. The player places the scene in the world.
4. Other players nearby can read it.
5. The scene expires or is removed depending on configuration.

#### Basic Admin Flow

1. Admin opens the scene tool or admin mode.
2. Admin creates or manages scene texts.
3. Admin checks visibility and placement.
4. Admin removes outdated or incorrect scenes.
5. Admin verifies persistence if enabled.

#### IC Summary

```txt
Something exists in the world → scene text describes it → players use it for RP
```

#### OOC / Technical Summary

```txt
Command/UI opens → text submitted → server validates → scene is synced → scene displays nearby
```

***

### Commands

Command names may depend on configuration.

Common command examples:

```txt
/scene
/scena
/sl_scene
```

Possible admin command examples:

```txt
/sceneadmin
/sl_scene_admin
```

Check `config.lua` for the exact command names used by your installed version.

Commands are useful for opening the scene interface and managing scene text.

***

### Permissions

Permission setup depends on server configuration.

Common permission levels may include:

```txt
view
use
manage
admin
owner
```

Recommended access logic:

```txt
Players = create/read scenes if allowed
Staff = manage or remove problematic scenes
Admins = full scene management
Owners = full access
```

Permissions may use:

* Ace permissions
* Framework groups
* Jobs
* Job grades
* Config admin list
* Custom permission bridge

Check `config.lua` and `custom.lua` for your server setup.

***

### Scene Writing Guidelines

Good scene text should be:

```txt
short
clear
visible IC information
environmental
non-forcing
easy to understand
```

Good examples:

```txt
A broken phone lies under the bench.
There are tire marks near the curb.
The table has several empty bottles on it.
A small note is taped to the wall.
```

Avoid:

```txt
forcing emotions
revealing OOC information
accusing a player directly without RP basis
writing very long paragraphs
using scene text for spam
placing text where it blocks gameplay
```

Bad examples:

```txt
Everyone feels afraid here.
You know the suspect is Mike.
You are not allowed to enter.
This person is guilty.
```

***

### Configuration

Open:

```txt
config.lua
```

Common settings may include:

```txt
Product information
Locale
Debug mode
Startup logs
Command settings
Scene creation settings
Scene visibility distance
Text style
Temporary scene duration
Persistent scene settings
Database settings
Permissions
Admin settings
Cooldowns
Limits per player
Cleanup settings
```

Recommended for production:

```lua
Config.Debug = false
```

Use debug mode only while testing or troubleshooting.

***

### Custom Integrations

Open:

```txt
custom.lua
```

Use this file for server-specific functions such as:

* Custom notifications
* Custom permission checks
* Custom framework integration
* Custom logging
* Custom admin checks
* Custom player identifier logic

If your server uses standard systems, you may not need many changes here.

***

### Startup Logs

When the resource starts correctly, you may see logs similar to:

```txt
[sl_scene][INFO] Server ready: SL Scene v1.1.12
[sl_scene][INFO] Client ready: SL Scene v1.1.12 | Use /scene
```

If startup logs are disabled, check `config.lua`.

***

### Troubleshooting

#### Scene tool does not open

Check:

```txt
- The resource is started.
- Commands are enabled in config.lua.
- You are using the correct command.
- You have permission to use the tool.
- F8 console has no errors.
- Server console has no errors.
```

***

#### Scene does not appear

Check:

```txt
- Scene was confirmed correctly.
- You are within visibility distance.
- The scene is active.
- Text display is enabled.
- No permission/job restriction is hiding it.
- Client F8 console has no draw/display errors.
```

***

#### Scene disappears after restart

Check:

```txt
- Persistence is enabled.
- Database is configured correctly.
- oxmysql starts before sl_scene.
- SQL tables exist.
- Scene was saved as persistent if required.
```

If temporary-only mode is enabled, scenes may not remain after restart.

***

#### SQL errors

Check:

```txt
- oxmysql is started.
- Database connection is working.
- sql/install.sql was imported if required.
- Automatic migrations completed successfully if enabled.
- Server console does not show duplicate column/key errors.
```

***

#### Expired scenes are not removed

Check:

```txt
- Expiry system is enabled.
- Scene has an expiration time.
- Cleanup settings are enabled.
- Database time format is valid.
- Server console has no SQL errors.
```

***

#### Players can create too many scenes

Check:

```txt
- Per-player limits.
- Cooldowns.
- Permission levels.
- Admin cleanup options.
- Scene duration settings.
```

Recommended:

```txt
Use limits and expiry to avoid clutter.
```

***

#### Text is too hard to read

Check:

```txt
- Text size.
- Draw distance.
- Background/shadow settings.
- Color settings.
- Placement height.
- Scene density in the area.
```

***

#### Normal players can delete admin scenes

Check:

```txt
- Delete permissions.
- Owner/admin permission checks.
- custom.lua permission bridge.
- Framework group detection.
```

***

### Version Notes

#### v1.1.12

* Continued stabilization of database/migration behavior.
* Improved reliability around active scene loading and expiry handling.
* Focused on cleaner runtime behavior and fewer SQL edge-case issues.

#### v1.1.x

* SQL migration protections improved.
* Expired scene handling refined.
* Cache and sync behavior improved.
* Visual presentation polished.
* Persistent scene behavior improved through hotfixes.

***

### Support

When asking for support, include:

```txt
Product: SL Scene
Resource name: sl_scene
Version:
Framework:
Database:
Issue:
Steps to reproduce:
Server console error:
Client F8 error:
Screenshot/video:
```

Example:

```txt
Product: SL Scene
Resource name: sl_scene
Version: v1.1.12
Framework: Qbox
Database: oxmysql
Issue: Scene creates correctly but disappears after restart
Steps to reproduce: Create persistent scene, restart resource, return to location
Server console error: attached
Client F8 error: none
Screenshot/video: attached
```

***

### Final Notes

SL Scene works best when used for clear, short and useful roleplay context.

For best results, encourage players and staff to write scene text that describes the world, supports roleplay and avoids forcing actions or conclusions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://sl-scritps.gitbook.io/sl-scripts-documentation/products/sl-scene.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
