Attribute num value not adding or subtracting

Attribute num value isn’t being changed.

local Damage = 5
local hitbox = script.Parent.Hitbox
local DamageAttack = hitbox:GetAttribute("AttackDamage")

DamageAttack = Damage

1 Like
  1. first GetAttribute() just gets an Attribute but you can’t set it
  2. DamageAttack is passing hitbox:GetAttribute() by value not by reference

You would have to do:

hitbox:SetAttribute("AttackDamage", Damage)
2 Likes