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)