Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Would MouseButton1Click Work on All Devices?

Asked by 8 years ago

So I'm making a developer product Gui, and I want it to be bought by everyone, especially console players, so if I used MouseButton1Click on the Gui, can Console players click it?

If not, what do I use?

This is the script with it:

buyButton.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)
0
Yeah. User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I would say no because on consoles they wouldn't use a mouse. Instead of this:

Button.MouseButton1Click:connect(function()
    print("Button Pressed!")
end)

You would want to use Input Began. The InputBegan event allows you to check the type of input, as well as the source of the input, and the state of the input. All of which are very useful for controller optimization.

Ad

Answer this question