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

How to make a button that prompts you every-time you step on it?

Asked by 4 years ago
Edited 4 years ago

So, i created this script that when you press on these buttons they prompt you :)

Here's the script:


local MarketPlaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local PromptSpeed = game.Workspace:WaitForChild("PromptSpeed") local PromptBox = game.Workspace:WaitForChild("PromptPart") local PromptPower = game.Workspace:WaitForChild("PromptJump") local PromptVip = game.Workspace:WaitForChild("PromptVIP") local function OnPromptPurchase(player, gamepassId) local HasPass = false local Humanoid = player.Parent:FindFirstChildOfClass("Humanoid") if (Humanoid) then player = Players.LocalPlayer HasPass = MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamepassId) end if HasPass then print("Player has the gamepass!") end if not HasPass then PromptSpeed.Touched:Connect(function(player) MarketPlaceService:PromptGamePassPurchase(player, 8638546) end) if not HasPass then PromptBox.Touched:Connect(function(player) MarketPlaceService:PromptGamePassPurchase(player, 8582273) end) if not HasPass then PromptPower.Touched:Connect(function(player) MarketPlaceService:PromptGamePassPurchase(player, 8796152) end) if not HasPass then PromptVip.Touched:Connect(function(player) MarketPlaceService:PromptGamePassPurchase(player, 8757181) end) end end end end end

Answer this question