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

Is there an error in this script that could affect how a ClickDetector reacts?

Asked by 10 years ago
local ID = 141627671


script.Parent.ClickDetector.MouseClick:connect(function(player)
    Game:GetService("MarketplaceService"):PromptPurchase(player, ID)
end)

In game when i click on the part, the mouse doesn't change to the "Click Hand" or whatever, and it activates if I click with the right mouse button. Is there a way to fix this?

2 answers

Log in to vote
2
Answered by
Damo999 182
10 years ago
local ID = 141627671

a = Instance.new("ClickDetector",script.Parent)-- i did this and it worked

script.Parent.ClickDetector.MouseClick:connect(function(player)
    Game:GetService("MarketplaceService"):PromptPurchase(player, ID)
end)
Ad
Log in to vote
-2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

I'm not sure that the parameter from a MouseClick event returns the player..

Answer this question