There were three things that were potentially wrong here.
1: The name of the tool has a space
2: The connected function passes no arguments
3: (Not a real problem) Your code is not indented and it bothers me
Here is your code rewritten to address the second problem. I would strongly recommend that you use the ServerStorage service instead of Lighting.
03 | local gamePassID = 233549351 |
04 | local PassService = game:GetService( "GamePassService" ) |
05 | local tools = { "The Beans" } |
07 | function respawned(char) |
08 | local player = game.Players:FindFirstChild(char.Name) |
10 | if char:FindFirstChild( "Head" ) then |
11 | print ( "It's a Player!" ) |
12 | if PassService:PlayerHasPass(player, gamePassID) then |
15 | local tool = game.ServerStorage:FindFirstChild(tools [ i ] ):Clone() |
16 | tool.Parent = player.Backpack |
24 | game.Players.PlayerAdded:connect(respawned(char)) |
Or, if you wanted to, you could put all the tools in a folder (Model) inside the ServerStorage. This address both the first and second problem
03 | local gamePassID = 233549351 |
04 | local PassService = game:GetService( "GamePassService" ) |
05 | local tools = game.ServerStorage.Tools:GetChildren() |
07 | game.Players.PlayerAdded:connect( function (char) |
08 | local player = game.Players:FindFirstChild(char.Name) |
10 | if char:FindFirstChild( "Head" ) then |
11 | print ( "It's a Player!" ) |
12 | if PassService:PlayerHasPass(player, gamePassID) then |
14 | for i, v in pairs (tools) do |
15 | local tool = v:Clone() |
16 | tool.Parent = player.Backpack |