So this is my gamepass script for a player to receive an "Exceed" so they can fly around the map. Apparently it pops up with an error "Backpack is not a valid member of Player" does anyone know why?
local passId = 000000000
local Tools = {"Exceed"}
local GamePassService = game:GetService("GamePassService")
game.Players.PlayerAdded:Connect(function(Player)
repeat wait() until Player.Backpack
repeat wait() until Player.StarterGear
if GamePassService:PlayerHasPass(Player, passId) then
for i = 1, #Tools do
game.Lighting.Tools:FindFirstChild(Tools[i]):Clone().Parent = Player.Backpack
game.Lighting.Tools:FindFirstChild(Tools[i]):Clone().Parent = Player.StarterGear
end
end
end)

2 comments
Also, don't use Lighting for storage. Use ReplicatedStorage when accessing from LocalScripts and ServerStorage when accessing from Server Scripts.
I appreciate the help I was so confused on my it wouldn't work. Thank you so much!