Help! I have 2 scripts that are exactly the same
Script 1
local id = game.ReplicatedStorage.Values.GamePassID.Value game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and ido == id then script.Parent.Visible = true print("showing") end end) game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:connect(function(char) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then script.Parent.Visible = true end end) end)
This one works but then script 2, which is almost identical except for the path above ( the local id = ...) doesn't work!
local id = game.ReplicatedStorage.Values.JumpPassID.Value game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and ido == id then script.Parent.Visible = true end end) game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:connect(function(char) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then script.Parent.Visible = true end end) end)
Here's a pic of the path :file:///C:/Users/stefa/Videos/Screenshot%202022-03-17%20152515.png
Why?
local id = game.ReplicatedStorage.Values.JumpPassID.Value game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and ido == id then script.Parent.Visible = true --Make sure your paths are correct and not client sided end end)