game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
repeat wait() until p:FindFirstChild("Backpack")
game.ServerStorage.Weps:GetChildren()[math.random(1,
#game.ServerStorage.Weps:GetChildren())]:clone().Parent = p.Backpack
end)
wait(2)
end)
how to convert this to working only if owning gamepass?

2 comments
you should use indentation
line 4-5 are connected