Okay so long story short, the function is being called without me clicking on the GUI button which is the thing thats supposed to fire it. It prints
{
[1] = 1,
[2] = 2,
[3] = 3,
[4] = 4
} Gear - Client
1 - Client
2 - Client
3 - Client
4 - Client
1 1 - Client
2 2 - Client
3 3 - Client
4 4 - Client
Attempt to connect failed: Passed value is not a function
RIGHT after I press play. After pressing the gui button afterwards just throws the same error, and doesn’t print the numbers. Also, I can’t click on the error. Here’s the full code, pls help
script.Parent.Position = UDim2.new(0.15,0,1,0)
script.Parent.Visible = false
local gear = {1,2,3,4}
local function SwitchCategory(category, stringName)
print(category, stringName)
script.Parent.ShopCategoryLabel.MaxVisibleGraphemes = 0
script.Parent.ShopCategoryLabel.Text = stringName
for count = 1, string.len(stringName) do
script.Parent.ShopCategoryLabel.MaxVisibleGraphemes = script.Parent.ShopCategoryLabel.MaxVisibleGraphemes+1
wait()
print(script.Parent.ShopCategoryLabel.MaxVisibleGraphemes)
end
for i,v in ipairs(category) do
print(i,v)
end
end
script.Parent.GearButton.MouseButton1Click:Connect(SwitchCategory(gear, "Gear"))