Now i know it is probably obvious the answer and all but i can't for the life of me figure it out . . . So, A little help please?
while wait(5) do
if script.Parent.NumZom.Value ~= 4 then
local sp = script.Parent.Parent.Spawn:GetChildren()
local Zom = Game.ReplicatedStorage.Zombie
local Num = script.Parent.NumZom
Num.Value = Num.Value + 1
local Zombie = Zom:Clone()
Zombie.Parent = workspace
Zombie:MoveTo(math.random(#sp.Position))
end
end
outpost:
02:35:57.306 - Workspace.MAIN.Script:35: attempt to get length of field 'Position' (a nil value) 02:35:57.307 - Stack Begin 02:35:57.307 - Script 'Workspace.MAIN.Script', Line 35 02:35:57.308 - Stack End
Full scrip | | | | | | | | vvvvvvv
-- Zombie Spawner --
-- By Coffeemesh -- -- Credits --
-- *UristMcSpark -|- Drooling Zombies (i renamed)
-- *CoffeeMesh -|- Scripting & Black Center Piece
-- DO NOT EDIT PAST THIS POINT!
-- | | | | | | | | | | | | | |
-- v v v v v v v v v v v v v v
--___________________________________________________________________________________--
Instance.new("IntValue", script.Parent)
script.Parent:WaitForChild("Value")
script.Parent.Value.Name = "NumZom"
--
--
--
--
---
--
--
--
--
--
--
--
--
while wait(5) do
if script.Parent.NumZom.Value ~= 4 then
local sp = script.Parent.Parent.Spawn:GetChildren()
local Zom = Game.ReplicatedStorage.Zombie
local Num = script.Parent.NumZom
Num.Value = Num.Value + 1
local Zombie = Zom:Clone()
Zombie.Parent = workspace
Zombie:MoveTo(math.random(#sp.Position))
end
end

3 comments
I don't think you can use math.random for MoveTo(), I would try using like a math.random 1-10 or something, and give each value a spawn position, and depending on the number it roles, that's where it spawns. (But I am by no means an expert on math.random() Just giving my thoughts
That error is occuring at Line 35, can we see the full script?
Yes Master ill post it