Im trying to display damage done by a rock In my game to and object. The health attribute is not changing. Both the attributes are integers.
local db = true
script.Parent.Touched:Connect(function(hit)
if hit.Name == "Handle" and db == true then
db = false
local health = script.Parent:GetAttribute("Health")
local damage = hit:GetAttribute("Damage")
health = health - damage
script.Parent.Gui.hp.Text = script.Parent:GetAttribute("Health")
wait(.7)
db = true
end
end)
I have tried using .Value after each one and I’m getting errors.