I created this script but it doesn't work, it's a VIP door. Don't know what I'm doing wrong but any and all help would be greatly appreciated, thanks. This is in a regular script inside a block.
local ID = 1369781260 plr = game.Players.LocalPlayer debounce=false function onTouched(hit) if debounce==true then return end debounce=true game:GetService("MarketplaceService"):PromptPurchase(plr, ID) debounce=false end script.Parent.Touched:connect(onTouched)
local ID = 1369781260 debounce=false function onTouched(hit) if debounce==true then return end debounce=true local plr = game.Players:WaitForChild(hit.Parent Name) game:GetService("MarketplaceService"):PromptPurchase(plr, ID) debounce=false end end script.Parent.Touched:connect(onTouched)
Roblox's GamePass service likes to act stupid. try this script.
local ID = 1369781260 debounce=false local market = game:GetService("MarketplaceService") local pass = game:GetService("GamePassService") function onTouched(hit) if debounce ~= true then debounce = true if hit.Name ~= "Handle" then local plr = game.Players:WaitForChild(hit.Parent.Name) if not pass:PlayerHasPass(plr, ID) then market:PromptPurchase(plr , ID) end else local plr = game.Players:WaitForChild(hit.Parent.Parent.Name) if not pass:PlayerHasPass(plr, ID) then market:PromptPurchase(plr , ID) end end debounce=false end end script.Parent.Touched:connect(onTouched)
if it doesn't work, let me know. Also, sometimes the part hits the player's hair before it hits the actual body, so I added in a workaround for that as well.