Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I handle a class table in a modulescript?

Asked by 4 years ago

Hello! Right now I'm trying to make a game with multiple (player) classes, and in order to prevent clutter I want to put all the classes into a modulescript. I would then return a dictionary of classes and their individual stats and specials. Right now I have this in the module.

local Classes  = {}
Classes["Shedletsky"] = {
    health = 100
    damage = 10
}

return Classes

It dosent seem to work though. Any help would be appreciated, even just a link to a helpful article.

0
Could you tell us what's not working? are you getting any errors? And if that's the case, then be sure to show us. ScuffedAI 435 — 4y
0
From just looking at your code, i can tell that you're missing a comma at line 3 ScuffedAI 435 — 4y
0
Oh thats probably it pengalu200 65 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Kate_Ai helped me fix it, I was missing a comma

Ad

Answer this question