[Code]
local Players = game:GetService("Players");
local Teams = game:GetService("Teams");
local function onPlayerNew(person)
local f3xClone = game.StarterPack.Gold.F3X:Clone();
f3xClone.Parent = person:WaitForChild("Backpack"); -- Trouble
end
local function onPlayerAdded(player)
-- Check if team is Gold Builder + if spawned
if player.Character and player.TeamColor == "Gold" then
onPlayerNew(player);
end
-- Listen for the player (re)spawning
player.CharacterAdded:Connect(onPlayerNew());
end
-- Iterate over each player already connected
-- to the game using a generic for-loop
for i, player in pairs(Players:GetPlayers()) do
onPlayerAdded(player);
end
-- Listen for newly connected players
Players.PlayerAdded:Connect(onPlayerAdded);
[Error/Issue]
While running a "Playing Solo" test:
ServerScriptService.Script:6: attempt to index local 'person' (a nil value)
[Info]
I have a F3X tool in a folder in StarterPack. I have a script in ServerScriptService. I want only players that are part of a certain team (the TeamColor is "Gold") to have this tool. I have spent a number of hours on the official documentation, but still haven't been able to find out what the issue is. Help would be greatly appreciated.

2 comments
The thing is that the new function won't be able to take any parameters if I do this
P.S. I am not the one who downvoted you