Cleanest way to setup these dictionaries / tables?

Currently i’m saving the player character Motor6D along with their initial C0 properties in tables, however i haven’t found a clean method to do this.

The problem for this method is that i have to create another table, which would hold the initial C0 properties.

local motorTable = {
	-- Every Motor6D
}

As for this one i would have to create a variable for every Motor6D, then shove them into tables.

local data = {
	c0 = {};
	motors = {}
}

I have no idea anymore.

For context, i’m passing the tables to the Server using a RemoteEvent. And yes i’ve tried copying the raw CFrame from every Motor6D, but they’re way to large and make the script harder to read, hopefully this is understandable.

2 Likes

You could create a dictionary with the keys being the different motors, then the values being another table or just the default value of their C0, whatever you need.

An example would be like:

local motor_data = {}
motor_data.root_motor_C0 = char.HumanoidRootPart.NameOfMotor.C0

Then I could access whatever motor I needed, whether it being the right shoulder, left shoulder, etc.

I hope this helps :slight_smile:

1 Like