How would I type check for a specific set of allowed strings?

You could just make a module script and require it to export all they type from there. If you don’t want hundred of clutter type-check on your function parameter. An example follow by nicemike40 post: Exported types in Luau - #4 by nicemike40

Module script

export type name = "Fireworks" | "ButtonPush"
return nil

Your Module script

local types = require(path.to.ModuleScript)

local WorldFx = {}

local WorldFx:TriggerClient(name: types.name, ...)
      --things to do
end

return WorldFx

Happy type checking!

1 Like