I wana to know so i can make a game
If you are talking about when a player clicks on a gui, then
local Button = script.Parent Button.MouseButton1Click:Connect(Function() --Your Code Here end
Make sure to put this script in a textbutton or an imagebutton
If you want to just check if the player makes a mouse click in general, then this code will be right for you.
-- This should be in a local script local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.Button1Down:connect(function() -- When you press the button end) mouse.Button1Up:connect(function() -- When you let go of the button end)
Marked as Duplicate by User#19524
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?