Hello fellow developers! Today I was making a deploy script and I was getting a weird error.
I the object im getting the children from is a folder.
Here is the function, which is in a script in ServerScriptService.
events:WaitForChild("DeployEvent").OnServerEvent:Connect(function(humanoidrootpart)
local spawnparts = game:FindFirstChild("SpawnParts"):GetChildren()
humanoidrootpart.CFrame = spawnparts[math.random(1,8)].CFrame
end)
Thanks for your help!