How to make -= 1 with attribute roblox

Here code. But “-=” is error

npc:SetAttribute("Recept") -= 1 

TypeOf attribute - int

1 Like

try getting the value before setting it.

local value = npc:GetAttribute("Recept")
npc:SetAttribute("Recept", value - 1)
1 Like

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