Script / Create
script-createCreates a new Godot C# or GDScript file at a res:// path from provided source, validates GDScript syntax, and rejects writes when the file already exists.
Instructions
Create a NEW Godot script file (C# '.cs' or GDScript '.gd') under res:// with the provided source. Fails if a file already exists at the path — use 'script-update' to overwrite. GDScript content is syntax-validated before write (invalid '.gd' is rejected and nothing is written); C# is accepted as-is (no in-editor compiler) and the post-write build settle surfaces compile errors. Missing parent directories are created. For a '.cs' file the editor filesystem reimports and BOUNDED-settles before returning (then 'script-build' builds the project and loads the new type); a '.gd' file only needs a filesystem update. Returns a structured ScriptInfo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Source code for the new script file. | |
| scriptPath | Yes | res:// path for the new script, ending in '.cs' (C#) or '.gd' (GDScript), e.g. 'res://scripts/Enemy.cs' or 'res://scripts/player.gd'. |