[UNSOLVED] OOP, trying to get self from Sword:Attack()

That’s for type annotations. An important reminder, type annotations in Luau are literally annotations; they do not and should not affect the compilation or runtime* (few edge cases) of the code. typeof used in this context retrieves the type of a value. For example:

local a: typeof(workspace) = nil::any
--even though this variable is nil, the autocomplete feature will still treat it
--as if it's actually workspace itself because it has been assigned that type
2 Likes

Oh that’s just normal typechecking, it doesn’t really affect anything

It works! Thank you very much!!! :grin:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.