Some Random Syntax Error?

What does

--!

actually do?

I can’t find anything on what it does.

It does quite literally nothing, it’s just a comment.

This is used for different types of typechecking while scripting. Declaring it will kind-of enable a certain type-check mode. For example, --!nocheck will make it so there’s no typechecking, --!strict will make it have typechecking, --!nonstrict is basically the normal typechecking you have.

1 Like

What exactly is “typechecking”?

Typechecking (as said) checks the types of certain Objects, Classes, userdatas and many more things. For example, If we write a function that it takes the Name argument, We can optionally use typechecking so the script knows that the argument must be a string. If we call the function but pass a number instead of a string, a red line will appear under the function. That’s what ROBLOX’s current scripting language does! (Luau, It’s basically Lua but better) You can learn more about Luau typechecking here!

local function GetName(Name: string) -- It MUST be a string.
	return "Hello my Name is "..Name.."!"
end

GetName("Crunch") -- Ok
GetName("ROBLOX123") -- Ok
GetName(123) -- Not Ok, Redline!