How to run a function into a list?

local p = game.Players:GetChildren()

for i = 1,#p do

frog(p[i])

end

Frog is a function that has a loop in it

Output is this, which is this the “frog(p[i])” line
[Workspace.Killer Blocks.Script:6: attempt to call a nil value]

I’m not sure why it’s saying the player is nil?

The function frog is declared after the for loop, thus making it error. Try declaring the function before running it.

1 Like