How do you change an attributes value

I’m making a plugin and I’ve been trying to test it. I want to change an attributes value so I can test it further more. I’ve tried that and my script didn’t work.

Here’s my script:
Attempt 1:

game.Players.PlayerAdded:Connect(function()

script.Parent:GetAttribute("CustomPart1").Value = true

end)

Attempt 2:

game.Players.PlayerAdded:Connect(function()

script.Parent:GetAttribute("CustomPart1") = true

end)

Attempt 1 gave me this error:


Attempt 2 gave me this error:

1 Like

Instance:SetAttribute(attrName, value)

9 Likes

Yes, I just tried that right after you commented. :laughing:

1 Like

You may be looking to do script.Parent:SetAttribute("CustomPart", true)

2 Likes