Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I handle a class table in a modulescript?

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.

3 comments

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.

0

From just looking at your code, i can tell that you're missing a comma at line 3

0

Oh thats probably it

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.