while true do
wait(0.5)
spawnObj()
end
function spawnObj()
local part = Instance.new("Part")
part.Anchored = false
part.Position = Vector3.new(1,50,4)
part.Parent = game.Workspace
end
✓ ANSWER ACCEPTED
Why 'Workspace.SpawnObjects:3: attempt to call a nil value'?
1 answer
✓ Accepted answer
Hey! In your code, spawnObj() is nil on line 3 because you haven't defined it. You'll have to move switch them to make it work.
function spawnObj()
local part = Instance.new("Part")
part.Anchored = false
part.Position = Vector3.new(1,50,4)
part.Parent = game.Workspace
end
while true do
wait(0.5)
spawnObj()
end
2 comments
1
I love you! Thanks soo much
0
np, accept answer if it worked
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
could you mark my answer as solution