This is in local script.
local Tool = script.Parent local UserInputService = game:GetService("UserInputService") Tool.Equipped:Connect(function() if UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)== true then print("yay") end end)
i know this might be noob question but pls help

3 comments
Code block
what does code block mean?
There should be the lua logo when you're typing your question, you can use that to format your code to Lua. Anyways you can check my answer and see if it works