For some reason it keeps saying "Mousebutton1 is not a valid member of image label". No matter what i do it wont fix it. Any help?
local MarketplaceService = game:GetService("MarketplaceService") Shop = script.Parent.Shop local speedcoilgamepass = Shop.Gamepassitems.ScrollingFrame.ImageContainer1.SpeedCoilgamepass local Open = Shop.Parent.Open local player = game.Players.LocalPlayer local speedcoilgamepassID = 29031429 speedcoilgamepass.MouseButtonDown1:Connect(function() local success, message = pcall(function() haspass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, speedcoilgamepassID) end) if haspass then print("player already has the gamepass") else MarketplaceService:PromptGamePassPurchase(player, speedcoilgamepassID) end end) Open.MouseButton1Down:Connect(function() Shop.Visible=not Shop.Visible end)
Use an ImageButton instead of an ImageLabel. Its basically the same, but has the MouseButton1Down event you are looking for
If you don't want to use an ImageButton, your other option is to listen to the player's MouseClick with UserInputService, and check to see if their mouse is hovering above the Open ImageLabel manually.
Basically all you need to do is to make the ImageLabel a ImageButton, I also corrected some things in your script. Have a nice day!
local MarketplaceService = game:GetService("MarketplaceService") Shop = script.Parent.Shop local speedcoilgamepass = Shop.Gamepassitems.ScrollingFrame.ImageContainer1.SpeedCoilgamepass local Open = Shop.Parent.Open local player = game.Players.LocalPlayer local speedcoilgamepassID = 29031429 local haspass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, speedcoilgamepassID) speedcoilgamepass.MouseButton1Click:Connect(function() local success, message = pcall(function() haspass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, speedcoilgamepassID) end) if haspass then print("player already has the gamepass") else MarketplaceService:PromptGamePassPurchase(player, speedcoilgamepassID) end end) Open.MouseButton1Click:Connect(function() Shop.Visible = not Shop.Visible end)