So. I am kinda making a kind of fnaf game. I've attempted this before it has not even worked with Names / ID's, Please fix. Its HardMode BTW
local debounce = false local Clicked = false local MarketplaceService = game:GetService("MarketplaceService") local player = game.Players.LocalPlayer local hasPass = false local Bypassed = { "Panda_Scopez12"; } gamePassID = 7415466 script.Parent.MouseButton1Click:Connect(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID) if Bypassed == player.Name then wait(0.2) hasPass = true end if hasPass == true and debounce == false and Clicked == false then debounce = true Clicked = true script.Parent.Text = "Hard Mode: On" script.Parent.Parent.Parent.HardMode.Value = true wait(0.5) debounce = false elseif hasPass == true and debounce == false and Clicked == true then debounce = true Clicked = false script.Parent.Text = "Hard Mode: Off" script.Parent.Parent.Parent.HardMode.Value = false elseif hasPass == false and debounce == false then MarketplaceService:PromptGamePassPurchase(player, gamePassID) script.Parent.Text = "ACCESS DENIED" wait(1) script.Parent.Text = "Hard Mode: Off" script.Parent.Parent.Parent.HardMode.Value = false wait(0.5) debounce = false end end)
You are attempting to compare a table value with a string value, do this
local debounce = false local Clicked = false local MarketplaceService = game:GetService("MarketplaceService") local player = game.Players.LocalPlayer local hasPass = false local Bypassed = { "Panda_Scopez12"; } gamePassID = 7415466 script.Parent.MouseButton1Click:Connect(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID) for i,v in pairs(Bypassed) do if v == player.Name then hasPass = true break end end if hasPass == true and debounce == false and Clicked == false then debounce = true Clicked = true script.Parent.Text = "Hard Mode: On" script.Parent.Parent.Parent.HardMode.Value = true wait(0.5) debounce = false elseif hasPass == true and debounce == false and Clicked == true then debounce = true Clicked = false script.Parent.Text = "Hard Mode: Off" script.Parent.Parent.Parent.HardMode.Value = false elseif hasPass == false and debounce == false then MarketplaceService:PromptGamePassPurchase(player, gamePassID) script.Parent.Text = "ACCESS DENIED" wait(1) script.Parent.Text = "Hard Mode: Off" script.Parent.Parent.Parent.HardMode.Value = false wait(0.5) debounce = false end end)
If this helped mark this as the answer :D