Player roles and live scripts
Give players named game roles that your neo.toml grants live-script permissions to, check what a session knows about a player, and ban players from live scripting, from the Creator Hub.
On this page
Players can write and run their own scripts in a running game if the game allows it. Two things decide what each player may do:
- your game's
neo.toml, which says who may run live scripts and what each role's scripts may touch (see Script exposure); - what NEO knows about the player in your game: whether they own it, whether they're a friend of an owner, which roles you gave them, and whether you banned them from live scripting.
You manage the second part in the Creator Hub, on two pages of your game's management area: Player roles (under Configurations) and Live scripts (under Moderation). Owners and editors can use both.
What a session knows about each player#
When a player joins one of your game's servers, NEO tells the server's host who they are to your game:
| Means | |
|---|---|
| Owner | They created the game, or they're an owner on its team (Permissions). |
| Owner's friend | They're friends on NEO with one of the game's owners. |
| Roles | The roles you gave them on Player roles. Every player also holds player. |
| Banned from live scripting | You banned them on Live scripts. Owners can't be banned. |
NEO works this out from its own records each time a player connects. A player can't claim a role or pretend to be an owner's friend. When you grant or revoke a role, ban or unban someone, or change who owns the game, every running server of the game hears about it straight away: nobody has to rejoin.
How it meets your neo.toml#
[script.players]
allowed = "role:builder" # nobody, owner, friends, role:<name> or everyone
[script.roles.player]
grant = ["Platform.position:get"]
[script.roles.builder]
grant = ["Cube:spawn", "Cube.position:set", "Cube.size:set"]With this manifest, only the game's owners and players you gave builder may run live scripts, and a builder's scripts get the player grants plus the builder ones. With allowed = "friends", the owners and their friends may script, whatever their roles. A banned player can't run live scripts whatever allowed says, and any of their scripts that are running stop.
A role on Player roles does nothing until your neo.toml names it, and a role in neo.toml that nobody holds does nothing either. Spell them the same way.
Grant and revoke roles#
- In your game's sidebar, open Configurations ▸ Player roles.
- Type the player's username and the role, then choose Grant.
Role names follow the neo.toml rule: a lower-case letter, then up to 31 lower-case letters, digits or underscores (builder, admin, level_2). You can't grant player, because every player already holds it. A player can hold up to 32 roles in one game, and a game can have up to 10,000 grants.
The list shows who holds what, who granted it and when. Search by username, or pick a role to see only its holders. To take a role away, choose Revoke next to it.
Check a player#
Under Check a player, type a username and choose Check to see exactly what your game's servers are told about them: Owner, Owner's friend or Player, their roles, and whether they're banned from live scripting.
Ban a player from live scripting#
- Open Moderation ▸ Live scripts.
- Type the player's username and, if you like, a reason (up to 500 characters; only your team sees it).
- Choose Ban from scripting.
The player can still play your game. Your game's running servers are told at once, so the host can stop their live scripts and refuse new ones (see the note above). Banning someone who's already banned updates the reason. To lift a ban, choose Unban next to them.
The game's owners can't be banned from scripting in their own game.
Activity history#
Every grant, revoke, ban, unban and change of reason is in the game's Activity history, with who did it and when. Filter it with Player roles or Script bans.
From your own tools#
The same actions are in the Platform API's CreatorGameService: ListPlayerRoles, GrantPlayerRole, RevokePlayerRole, GetPlayerScriptAccess, ListScriptBans, BanFromScripting and UnbanFromScripting. See CreatorGameService.