Is it possible to click mouse via script?

deb = false
script.Parent.Touched:connect(function(part)
	if game.Players:FindFirstChild(part.Parent.Name) then
		if deb == false then
			deb = true
		     game.StarterGui.ScreenGui.Frame.All.MouseButton1Click:Connect()
		end
	end
end)

For example, I have few pets to select and I want to be clicked to all my pets at the same time by one click, can I make mouse to click without human with using only scripts?

As far as I am aware, there’s no feature for that.
I would recommend looking into ModuleScripts. You can write your code functionality in the ModuleScript, and then use it in places where you need it. (Trigger it when the user clicks, etc…)

Yes it is possible tho, but the code u’re doing is kinda wrong at part the startergui

You should do player.PlayerGui

If you’re trying to get the PlayerGui from the player, not the StarterGui, it’s game:GetService(‘Players’).LocalPlayer:WaitForChild(‘PlayerGui’)
should be changed to

game:GetService(‘Players’).LocalPlayer:WaitForChild(‘PlayerGui’).ScreenGui.Frame.All.MouseButton1Click:Connect()