Edit: Tool may not be the first index
Question
My F3X Giver Command Doesn't Work, How do I fix this F3X command giver script?
What Is Wrong
If we look at line 5 and 6,
local F3X = game:GetService("InsertService"):LoadAsset(142785488):GetChildren()
F3X:Clone().Parent = player.Backpack
:LoadAsset() returns a model containing the asset*(s)* you're attempting to load.
You will see that F3X is set to the array returned from the :GetChildren() method. When you try to call :Clone() it will error because the array likely doesn't have the :Clone() method as an index.
I believe you're trying to clone the child which is the tool into the player's backpack, which will be one of the indexes in the array returned. You can find it by iterating over the array.
Solution
Set F3X to the index which is the tool inside the array returned from :GetChildren() and then set it's parent to the player's backpack. (You don't need to clone it in this scenario)
local assets = game:GetService("InsertService"):LoadAsset(142785488):GetChildren()
local F3X
for i, asset in pairs(assets) do
if asset:IsA("Tool") then
F3X = asset
end
end
F3X.Parent = player:WaitForChild("Backpack")
Reading Resources
https://developer.roblox.com/en-us/api-reference/function/Instance/WaitForChild
https://developer.roblox.com/en-us/api-reference/function/Instance/GetChildren
2 comments
Are you getting any errors in the output?
Oh, you can't do .Parent on a read-only table which is what :GetChildren() does. I don't think you can even use :GetChildren() until the asset is loaded. One moment while I check.