Mouse.Button1Down does not seem to work when clicking buttons
Can you show the problem script atleast?
You literally can’t expect us to telepathically see your script. Send the script.
Try MouseButton1Down instead of Mouse.Button1Down
Do this
MouseButton1Down
Instead of
Mouse.Button1Down
If you want it to detect the button click do
Button.MouseButton1Down:connect(function()
end
Its MouseButton1Down
, theres no . in the scriptsignal (wrong syntX)
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
print("Clicked")
end
the function prints normally but when I click a gui button it does not
(sry that I didn’t send the script cause it was just mouse.Button1Down so I was not quite sure what to send)
You’re using the mouse object there. For the GUI button you want to use the GuiButton.MouseButton1Down
event
Yes I know, but I want Mouse.Button1Down to fire when I click a button
Why??? What is your objective? Do you always want it to fire when someone holds LMB down regardless of the position?
You aren’t giving us enough recourses from your script to help you.
Script that fires as a player clicks their mouse (not on a gui)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Button1Down:Connect(function()
print("Button 1 is down")
end)
If you want a script that fires as a player clicks a button:
Enter a script in the button and type this:
local button = script.Parent
button.MouseButton1Click:Connect(function()
print("Button got clicked")
end)
I making a selection box system. I need Mouse.Button1Down to fire so I can get the starting position of the mouse
Nevermind i have found a solution
What was the solution? Please say it so it will help other people who needs help with this.
May I know the solution? I really need the solution for the script of my game.
this thread is delightfully unhelpful
you can do this
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if not onRadialMenu(Mouse.X, Mouse.Y) then
-- code that runs when a player left clicks anywhere on screen on anything at all
end
end
end