Hello! I am trying to make my game better for viewing and I have came across an issue.
I am working on a survival game and tools such as axes and pickaxes can be used to damage objects. Therefore, I need to use a value to determine how much health an object is at. However, I want to switch everything to attributes.
While doing some basic testing, I noticed something that I don’t really understand.
local health = script.Parent:GetAttribute("Health")
script.Parent:SetAttribute(health, 50)
Here is a basic script I wrote on a regular part to test. When I run the game, it makes another attribute called “100” and sets the value to 50. I want the attribute called Health to change to 50.
Is this possible?