So im making a Plugin called “Scripx”.
Is there any way to flag code that is incorrect like the Script Editor?
Example:
The code gets a red line under it beacuse it is incorrect.
How do you do that?
So im making a Plugin called “Scripx”.
Is there any way to flag code that is incorrect like the Script Editor?
Example:
The code gets a red line under it beacuse it is incorrect.
How do you do that?
I think your best bet may be to create a custom GUI designed for editing the way you want. You could then create a rectangle and position it under the incorrect part of the script.
Yes, and I gave the solution for what you asked for; how to create a red line under text. The auto-flag feature would have to be programmed, and would be a pain to list all the conditions that cause a script to throw an error, so I feel the best practice might be using pcall() to see if the code already written throws an error or not.
How do i use pcall()? (30 char)
It is located on this page. Here’s a snapshot.
Here is some additional code to help explain how to use pcall.
local errorCall = pcall(function () error("Error!") end)
local successCall = pcall(function () print("No error!") end)
print(errorCall, successCall)
-- Prints: false, true
Because there isn’t enough tooling available in Roblox’s engine, you’d have to program this entire system, what I mean is that most linter engines will show
How could i use it to display an TextLabel with text “Error!” (inside of a widget)
when code is incorrect on a TextBox?
I’d recommend making a new scripting support forum for making a red line under specific text, as this is getting off-topic, going from how to detect an error into a GUI tutorial