Why MouseClick doesn't work as well for me

I am making a 3D interface and to the buttons I am adding the following script:

local function menuClick()
	Play.ClickDetector.MouseClick:Connect(function()
		print("hola")	
	end)
end

but it only works after many clicks, help me

Uhhhhh…

I’m sort of a new scripter, so I don’t know really…

BUT,
You could change MouseClick to MouseButton1Click?

(also pls look at my topic)

1 Like

I’m assuming you didn’t called the function. Is this part of the script?

1 Like

This should work, just make sure the part this is in is fine. Also, since this is wrapped inside of a function, are you calling it in the script as well? If you want to get the player who clicked, add this:

Play.ClickDetector.MouseClick:Connect(function(plr)
      print(plr.Name)
end)
2 Likes

haha thank you all but after publishing the topic I solved the problem of the part is that the click only worked on one side haha, thank you all <3.

1 Like

Oh glad it works now! I was thinking that the part maybe wasn’t made right.

1 Like

twe must be friends :wink: thank you brother

1 Like