Need help I’m learning bare with me

Is this correct format
Also any tips or anything like that would be appreciated as well


export type BombType = {
    Rarity: string,
    ID: string,
    Name: string,
    Mutation: string,
    MaxSize: number,
    PossibleResults: { [string]: number },
    MaxFill: number,
    MinFill: number,
    ExplosionForce: number,
}






1 Like

Yep, this is valid Luau

One small tip if Rarity or Mutation can only have certain values, you can use union types instead of string to make it more type-safe.

Other than that, the structure looks good.

2 Likes

Yes, correct

But truth:
Don’t bother with type-checking past primitives/functions
You will eventually learn how bad dictionaries are for “structs” and how useless typecheck is with them
Essentially all effort of typechecking dictionaries will go to waste because there are no runtime performance gains
Instead build architecture on buffers for that case

my resources to learn that stuff:

It’s better to learn than to stagnate

1 Like

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