I’m trying to achieve an equip system where you can equip different models/characters into different slots.
The functions that get called when the specific slot is pressed requires it to be double-clicked to have them actually work.
Coroutines caused them to just, not run, period. Not sure what the issue is.
function suitOrCPUButtonsClicked(whichType)
for _, v in pairs(GUI.Workshop.AnimatronicButtons.Frame.Icons:GetDescendants()) do
if v:IsA("ImageButton") then
v.MouseButton1Click:Connect(function()
if whichType == "Suit" then
local model = v.Value.Value
workshopModelRefresh()
workshopUIRefresh()
workshopSuitImageRefresh()
ReplicatedStorage.Events.ClientEvents.ChangeSlot:FireServer(currentSlot, model, "Suit")
else
print("CPU STUFF")
workshopUIRefresh()
end
end)
end
end
end
“whichType” right now is always Suit.
I’m unsure why this is happening, any help would be much appreciated.