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.
01 | local ID = 1369781260 |
02 | plr = game.Players.LocalPlayer |
03 |
04 | debounce = false |
05 |
06 | function onTouched(hit) |
07 | if debounce = = true then return end |
08 | debounce = true |
09 |
10 |
11 | game:GetService( "MarketplaceService" ):PromptPurchase(plr, ID) |
12 |
13 |
14 | debounce = false |
15 |
16 | end |
17 |
18 | script.Parent.Touched:connect(onTouched) |
01 | local ID = 1369781260 |
02 | debounce = false |
03 |
04 | function onTouched(hit) |
05 | if debounce = = true then return end |
06 | debounce = true |
07 | local plr = game.Players:WaitForChild(hit.Parent |
08 | Name) |
09 |
10 | game:GetService( "MarketplaceService" ):PromptPurchase(plr, ID) |
11 |
12 | debounce = false |
13 | end |
14 | end |
15 |
16 | script.Parent.Touched:connect(onTouched) |
Roblox's GamePass service likes to act stupid. try this script.
01 | local ID = 1369781260 |
02 | debounce = false |
03 | local market = game:GetService( "MarketplaceService" ) |
04 | local pass = game:GetService( "GamePassService" ) |
05 |
06 | function onTouched(hit) |
07 | if debounce ~ = true then |
08 | debounce = true |
09 | if hit.Name ~ = "Handle" then |
10 | local plr = game.Players:WaitForChild(hit.Parent.Name) |
11 | if not pass:PlayerHasPass(plr, ID) then |
12 | market:PromptPurchase(plr , ID) |
13 | end |
14 | else |
15 | local plr = game.Players:WaitForChild(hit.Parent.Parent.Name) |
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.