Things like this, I got some extensions like Luau and Rojo and all that but this keeps happening. How can I fix this?
get an LSP, also make sure you refresh vscode after (just restart it if you don’t know how)
The red underlines in VSCode appear because the Lua language extension you’re using doesn’t seem to recognise Roblox globals like Instance
or player
. These aren’t part of standard Lua but part of Roblox’s custom Luau environment and since VSCode doesn’t natively support Roblox APIs, it flags them as undefined…
To fix this, you can install the Rojo
and Roblox LSP
extensions for VSCode, which add Luau language support and Roblox API awareness. I believe this will remove the red underlines and provide proper autocomplete and type checking for Roblox development
Professional Roblox Game Development with Rojo.
How to use Rojo to easily create Roblox games!
Rojo for Roblox Actually Explained.
I got both of those extensions, but it still isn’t changing anything. I downloaded a bunch of LSPs and none of them worked lol. I got Luau, Luau Language Server, and Roblox LSP but its still there.
The red underlines you’re seeing in VSCode despite having those extensions are likely due to missing project configuration, can’t be other reason. Specifically, a roblox.toml
file and a proper Rojo setup (default.project.json
) that tells the language server it’s a Roblox project
Without these, the language server won’t attach correctly, and Roblox types like Instance
and IntValue
will show as undefined just make sure your .lua
files are being recognized as Luau (not Lua) in the bottom-right corner of VSCode, and that the Luau Language Server is running under the “Output” tab, once you have these set up, the underlines should disappear
Delete Roblox LSP. Luau LSP is enough and they may conflict.
To add to what everyone else is saying, if you are using Selene (you should anyways) you may be missing a selene.toml
file:
std = "Roblox"