So I have a local script fire a RemoteEvent and the firing and stuff works but the reciving script doesn't
It works in test but not in play mode, In play mode it gives the error: 'Workspace.BlockInserter:8: attempt to index a nil value' Line 8
NormalParts = {"Slab","Wall","Plate"}
local event = script.BlockInsertation
event.OnServerEvent:connect(function(player, name)
local chil = game.Workspace[name]:GetChildren()
for i = 1, #chil do
if chil[i].Name == NormalParts[1] or NormalParts[2] or NormalParts[3] then
local clone = game.workspace[name]:FindFirstChild(NormalParts[1] or NormalParts[2] or NormalParts[3]):Clone()
clone.Parent = game.Workspace
clone.Transparency = 0
print("Not brokenennn")
break
else
local con = script.Parent.MoneyDisplay.ClonedErrors:GetChildren()
if #con < 1 then
local cloneerror = script.Parent.MoneyDisplay.ErrorDisplay:Clone()
cloneerror.Parent = script.Parent.MoneyDisplay.ClonedErrors
cloneerror.Description.Text = "Undefined part value"
cloneerror:TweenPosition(UDim2.new(0.78, 0,0.92, 0),"In","Linear",.2,false)
wait(1.5)
cloneerror:TweenPosition(UDim2.new(0.78, 0,1.1, 0),"Out","Linear",.2,false)
wait(1)
cloneerror:Destroy()
end
end
end
end)

3 comments
Works in studio, not in play : <
How is "workspace" safer than "game.Workspace"?
Someone could put another object in called "Workspace", or "Workspace" could be renamed. They're silly things, but there's basically no reason to have that level of indirection. That's why
workspaceis defined for you.