local mps = game:GetService("MarketplaceService") local gamepass_id = 18476957 local pad = game.workspace.ProductStands.Horse.ColoredParts.TouchMe pad.touched:Connect(function(player) local player = game.Players.LocalPlayer mps:PromptGamePassPurchase(player, gamepass_id) end) mps.PromptGamePassPurchaseFinished:Connect(function(player, id, purchased) if id == gamepass_id and purchased then game.ReplicatedStorage.GiveHorse:FireServer() end end)
This is a localscript in starterplayerscripts
Greetings!
According to your script, if anyone, no matter who it is, touches the pad object, it will show up a gamepass prompt. A fairly easy fix to this is to check who touched the pad, and check if it is you or not.
pad.Touched:Connect(function(part) local player = game.Players.LocalPlayer if part:IsDescendantOf(player.Character) then --checks if the part that touched the pad is from your character mps:PromptGamePassPurchase(player, gamepass_id) end end)
If you're confused, I can answer some of your questions.
I hope this helps!