Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to fix ServerScriptService.MainLoop:42: attempt to index field 'Parent' (a nil value)?

I am Trying to parent a map to The Work space object but i keep getting This error when test it:

ServerScriptService.MainLoop:42: attempt to index field 'Parent' (a nil value)

MainLoop.lua :

local MapsFolder = ServerStorage:WaitForChild('Maps')
local AvailibleMaps = MapsFolder:GetChildren()

--------------------------------------------------Map Prossesing
local UsedMap = AvailibleMaps[math.random(1,#AvailibleMaps)]
	
local TemporaryMap = UsedMap:Clone()
TemporaryMap.Parent.Parent(workspace)
	
local SpawnPoints = TemporaryMap:FindFirstChild('SpawnPoints')
	
local AvailibleSpawnPoints = SpawnPoints:GetChildren()
-------------------------------------------------------

This Is Not The Whole Script But Just Everything I Think Is Relevant Ask In The Comments If You Have Any Questions

1 comment

0

Oh Sorry Fixed It by Changing The Parenting To TemporaryMap.Parent = workspace

1 answer

Oh Sorry Fixed It by Changing The Parenting To TemporaryMap.Parent = workspace

This discussion is preserved as it was. New answers, comments, and votes are closed.