game.Workspace.DummyCaptain.ClickDetector.MouseClick:Connect(function()
script.Parent.Parent.Parent.StarterGui.ShopClick.Frame.Visible = true
end)
its a gui right? we dont need a clickdetector on it because we dont need one frames already have their own events and if the script was a normal script then change it to a local script and write this
1 | game.Workspace.DummyCaptain.MouseClick:Connect( function () |
2 | script.Parent.Parent.StarterGui.ShopClick.Frame.Visible = not script.Parent.Parent.StarterGui.ShopClick.Frame.Visible |
3 | end ) |
game.Workspace.DummyCaptain.ClickDetector.MouseClick:Connect(function() script.Parent.Parent.Parent.StarterGui.ShopClick.Frame.Visible = false end)