function a()
	local plr = game.Players.LocalPlayer
	if plr.PlayerGui:FindFirstChild("UI") then
		print(plr.Name.." already has the UI")
	else
		script.Parent.UI:Clone().Parent = plr.PlayerGui
	end
end

script.Parent.ClickDetector.mouseClick:Connect(a)

2 comments

0

The ClickDetector doesn't have an event called "mouseClick;" the event for when a player clicks on it is called "MouseClick." (line 10)

0

Believe me, I tried it too, and the mouseClick event is recommended, like, it appears when you start typing.