How do you update attributes?

Hi, basically I create an attribute called “Deaths” when a player joins the game and set it to zero. However I was just wondering how to update that value by adding 1 to the previous value?

player:SetAttribute("Deaths", 0)


-- Would something like this work?
player:SetAttribute("Deaths", player:GetAttribute("Deaths") + 1)
2 Likes

You are correct. Your method is actually the method that everyone uses and it will work.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.