I was working on devil fruits. And I load the devil fruit moves based on what the player's fruit is. Heres my script:
(Error: 11:52:08.631 - ServerScriptService.MainScript.StatManager:12: bad argument #1 (table expected, got Object)
if data.DevilFruit.Value ~= "Nothing" then
local dfmoves = game:GetService("ReplicatedStorage").DevilFruits:WaitForChild(data:WaitForChild("DevilFruit").Value.."_Fruit")
local dfgui = game:GetService("ReplicatedStorage").DevilFruits.GUIs:WaitForChild(data:WaitForChild("DevilFruit").Value.."_GUI")
for i, v in pairs(dfmoves) do
v.Disabled = false
v:Clone().Parent = player.Backpack
end
-- Give Moveset
for i, v in pairs(dfgui) do
wait(1)
v.Enabled = true
v:Clone().Parent = player.PlayerGui
end
end

2 comments
14:44:25.012 - Infinite yield possible on 'ReplicatedStorage.DevilFruits:WaitForChild("_Fruit")'
That does not look like a problem with your for loop.