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?

4 comments
Going to need more info, can you provide a screenshot of where the script is for both of them? Just send a link
Ok i'll edit
You'll probably need to provide some more information. What do you mean by it doesn't work? Is there any error that gets shown? What is the script expected to do and what isn't working?
No errors are shown in any of the scripts. It's meant to show a gui only if a player owns a gamepass