Its not ideal, because i have multiple objects that will use different attack speed, something like this:
local ItemSettings = {
["Basic Sword"] = {
SLOT_SPACE_X = 2,
SLOT_SPACE_Y = 3,
VIEWPORT_CAMERA_CFRAME = CFrame.new(0, 3, 7) * CFrame.fromOrientation(math.rad(0), math.rad(0), math.rad(-22.5)),
EQUIPABLE_SLOT = "Weapon",
Rarity = "Very uncommon sword",
attack_speed = 0.5,
primary_function = {
name = "MeleeAttack",
combo_timeout = 2,
sequence = {
[1] = {
duration = 0.6,
damage_multiplier = 0.8,
anim = "Sword1_Attack1",
anim_speed = 1 * attack_speed,
cast_delay = 0.2,
cast_duration = 0.2,
},
[2] = {
duration = 0.5,
damage_multiplier = 0.6,
anim = "Sword1_Attack2",
anim_speed = 1,
cast_delay = 0.1,
cast_duration = 0.2,
},
[3] = {
duration = 1.2,
damage_multiplier = 2,
anim = "Sword1_Attack3",
anim_speed = 1,
cast_delay = 0.3,
cast_duration = 0.2,
}
},
},
anim_idle = "Sword1_Idle",
uses_melee_hitbox = true,
EquippedStats = {
Damage = 100,
CriticalChance = 0.2,
},
},
["Dagger"] = {
SLOT_SPACE_X = 1,
SLOT_SPACE_Y = 3,
--VIEWPORT_CAMERA_CFRAME = CFrame.new(0, 3, 7) * CFrame.fromOrientation(math.rad(0), math.rad(0), math.rad(22.5)),
EQUIPABLE_SLOT = "Weapon",
attack_speed = 0.5,
primary_function = {
name = "MeleeAttack",
combo_timeout = 2,
sequence = {
[1] = {
duration = 0.3,
anim = "Sword1_Attack1",
anim_speed = 1 * attack_speed,
cast_delay = 0.3,
cast_duration = 0.2,
},
},
},
anim_idle = "Sword1_Idle",
uses_melee_hitbox = true,
EquippedStats = {
Damage = 50,
CriticalChance = 0.1,
}
},
["Lil Knife :D"] = {
SLOT_SPACE_X = 1,
SLOT_SPACE_Y = 1,
--VIEWPORT_CAMERA_CFRAME = CFrame.new(0, 3, 7) * CFrame.fromOrientation(math.rad(0), math.rad(0), math.rad(22.5)),
EQUIPABLE_SLOT = "Weapon",
attack_speed = 0.5,
primary_function = {
name = "MeleeAttack",
combo_timeout = 2,
sequence = {
[1] = {
duration = 0.3,
anim = "Sword1_Attack1",
anim_speed = 1 * attack_speed,
cast_delay = 0.3,
cast_duration = 0.2,
},
},
},
anim_idle = "Sword1_Idle",
uses_melee_hitbox = true,
EquippedStats = {
Damage = 25,
CriticalChance = 0.05,
}
},
Every weapon uses different attack speed