Can't SetAttribute on a String Attribute

I am making a hotbar so the first thing would be assigning a string value to a String Attribute

This local script finds if something tool is inside Character. If it is then It will go through all the Hotbar Slots available and Disable/Unactivate all of them. Then It assignes a slot which has the name of the tool and activates that Slot.

  • The problem here is, It doesn’t assignes the tool name inside the Attribute.
char.ChildAdded:Connect(function(obj)
	if obj:IsA("Tool") then
		for i,v in pairs(Slots) do
			if v:GetAttribute("Assigned") == "" then
				for i,v in pairs(Slots) do
					Slots[i]:SetAttribute("Activated", false)
					v.BackgroundTransparency = 0.8
				end
				v:SetAttribute("Assigned", obj.Name) -- This Doesn't Work!
				v.BackgroundTransparency = 0.6
				v:SetAttribute("Activated", true)
				break
			end
		end
	end	
end)
1 Like

Okay, I don’t know what just happend but I guess because I tweaked the script a bit it suddenly started working. Sorry for bothering yall! I literally didn’t changed the script at all. I guess something else wasn’t working because I was working on another issue with the hotbar.

1 Like