Is there a way to pass the new value of the attribute from :GetAttributeChangedSignal()?

I want to make :GetAttributeChangedSignal() to pass the new attributes value, sort of like .GetPropertyChangedSignal()

It doesnt seem to exist

I looked on the forums and found nothing about this

function onMovesetChange(newChar)
	for _, Moveset in pairs(Movesets) do
		if newChar == Moveset then
			
			if Moveset == "Default" then
				deleteExcess()
				local Moves = movesets.Default:GetChildren()
				for _, move in pairs(Moves) do
					if move:IsA("Tool") then
						local tool = move:Clone()
						tool.Parent = player.Backpack
					end
				end
			end
			return
		end
	end
	print("No Moveset")
	player:SetAttribute("Moveset", "Default")
end

player:GetAttributeChangedSignal("Moveset"):Connect(function()
	onMovesetChange()
end)

Why don’t you just use GetAttribute in the listening function?

1 Like

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