IsActivated is not a valid property name

I am unsure as to why it’s spitting this out, as “IsActivated” is a valid attribute, and so it should work as a valid property name, and yet it doesn’t. Any help figuring this out would be most appreciated.

Script with an error

Handle:GetPropertyChangedSignal("IsActivated"):Connect(function()
	if Handle:GetAttribute("IsActivated") == true then
		Active = true
	else
		Active = false
		
	end
end)

Proof that it is the right attribute to check
image

1 Like

Oh yeah, I forgot to include the script that has the IsActivated within.

local Tool = script.Parent
local Handle = Tool.Handle

Tool.Activated:Connect(function()
	Handle:SetAttribute("IsActivated", true)
end)

Tool.Deactivated:Connect(function()
	Handle:SetAttribute("IsActivated", false)
	wait(3)
end)
1 Like

IsActivated is a custom attribute, so you need to use GetAttributeChangedSignal method instead:

Handle:GetAttributeChangedSignal("IsActivated"):Connect(function()
2 Likes

What a simple fix, thank you! Crazy how I couldn’t notice it before.

1 Like

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