Fire MouseButton1Clicked

Is there anyway I can Simulate the left mouse button being clicked for a Mouse object, kinda like Tool:Activate()

Can’t you just call the function you have connected to simulate it.

local function test()
    print("Hi")
end

mouse.Button1Down:Connect(test)

test() -- call it yourself to simulate click
1 Like

I am trying to find how to simulate the event itself being fired.

Calling the connected function would do just that.

I just said I dont want to do that.

Could you explain why not? Sorry to break it to you but there is no other way to “truly” simulate it. Plus, when an event is fired, your connected function gets called, so you wouldn’t even know if it was a simulation or the real thing.

1 Like

I just simply wish I could do something like Mouse:Button1Click() rather then trying to use events, and get multiple scripts at the same time to call different functions e.g

Well there is no such thing, so you will have to do my suggestion.

1 Like

Simply, [color=#FF5733]no[/color]. This is not possible due to there not being any specific built-in function available for this and you can’t force the Mouse object to click due to the security level for the scripts run during play to protect users from i.e. buying something they didn’t choose by forcing a mouse click on a prompt pop-up.

1 Like