Can you use an action(ex. MouseButton1Click) in an if statement?[in many ways]
Not only
if script.Parent.MouseButton1Click thena wrong example
IN MANY WAYS
Can you use an action(ex. MouseButton1Click) in an if statement?[in many ways]
Not only
if script.Parent.MouseButton1Click thena wrong example
IN MANY WAYS
You can wait for an event to happen or run a function when the event occurs. Using an event in a statement doesn't make any sense.
To wait for an event you can do Event:Wait() instead of Event:Connect(function)
You could also check if the mouse is down in your if statement by putting it in a variable
local Mouse = game.Players.LocalPlayer:GetMouse()
local MouseDown = false
Mouse.Button1Down:Connect(function()
MouseDown = true
end)
Mouse.Button1Up:Connect(function()
MouseDown = false
end)
--somewhere in ur code
if MouseDown then
Got it!
LOL
:') at least accept his answer
rubenkan big dum dum
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
So in short, the only way to do this is to use ...MouseButton1Click:Connect(function() ?
Yes.