-
What do you want to achieve? I need every character to have values that are constantly changing during gameplay.
-
What is the issue? I’m not sure how i should structure this system.
-
What solutions have you tried so far? I tried making a Table inside modules script. And everytime a character was added, a second table for that specific character would be created in that initial table.
ex: ModuleTable = {player1 = {}, player2 = {}}
This worked for a while, but i ran into problems. Mainly due to the fact that i can’t detect changes made to a table (like a .Changed event) and because you can’t have multiple items of the same name in a table.
The new way i thought of doing this is by having this script in ReplicatedStorage:

CharacterAdded:Connect(function(Character)
local clone = script.InfoFolder:Clone()
clone.Parent = Character
end)
Whenever i want an attack to be on cooldown, i add an BoolValue with the attack’s name to the Cooldowns folder, and then add it to debris with the duration of the attack
local Table = {["boolean"] = "BoolValue", ["number"] = "NumberValue", ["string"] = "StringValue"}
AddInstance = function(Name, Value, Parent, Lifespan)
-- This creates an instance with the type of value given
local NewValue = Instance.new(Table[typeof(Value)])
-- Ex: if Value is a "boolean" then it will create a "BoolValue"
NewValue.Name = Name
NewValue.Value = Value
Debris:AddItem(NewValue, Lifespan)
NewValue.Parent = Parent
end
-- In another script
local Cooldown = Character.InfoFolder.Cooldowns:FindFirstChild(Attackname)
if not Cooldown then
-- Attackscript
end
How bad is this bad for performance? It’s the only way that worked for me.