local dataSource = require(game.ServerScriptService.BehaviorLogic) function playerJoined(player) local gear = dataSource["GetInfo"](player, "GetGear") SetupGear(player, gear) end local ins = game:GetService("InsertService") function SetupGear(player, gear) --wait(5) uncommenting this line makes it work for _, assetId in ipairs(gear) do print("Granting"..tostring(assetId)) local tool = ins:LoadAsset(assetId):GetChildren()[1] print(tool) tool.Parent = player.Backpack end end game.Players.PlayerAdded:Connect(playerJoined)
Add this line to ensure the character is fully loaded.
player.CharacterAdded:Wait()
You can use game.Loaded:Wait()
to wait until the game is completely loaded, you should put this in a local script, then after that line you can fire a remote event to the server and give them the tool then.
if you want to go with the character, then use repeat wait() until player.Character
Alternatively you can just add a wait(5)
or more seconds before you give the tool.
Also the player joined function should be beneath the setup tools function.