So I was trying to make a holo, and the loading works. I can say "load meadows" and it would load meadows. But clearing does not work. I want to set the children of holo's parent to Lighting when I say "clear" so I put this code
player.Chatted:connect(function(msg) if msg == "clear" then for index, child in pairs(workspace.holo:GetChildren()) do index, child.Parent = game.Lighting end end
But instead of changing the parent to Lighting, it removes it altogether so that I can't load it again. Am I doing something completely wrong?
index
is literally the current index the table is at -- it's just a number. You don't want to re-parent a number, you want to re-parent the object.
child.Parent = game.Lighting
Although you really shouldn't use Lighting for storage. Roblox provides ServerStorage and ReplicatedStorage services for such things.