It says "parent is not a valid member of Model"
for _, object in pairs(game.ServerStorage:GetChildren()) do local CarCopy = object:clone() CarCopy.parent = game.Workspace CarCopy:MakeJoints() end
I want to make the CarCopy to go in to the Workspace from my ServerStorage but it is not doing it here is all the scripts in that one script
local RespawnCarsBlock = game.Workspace.RestartCars function RespawnCars() print("Cars is respawning!") for _, object in pairs(game.Workspace:GetChildren()) do print(object.name) if object.name == "Motorcycle" then print("this is a Motorcycle we need to destroy it!") object:destroy() end end for _, object in pairs(game.ServerStorage:GetChildren()) do local CarCopy = object:clone() CarCopy.parent = game.Workspace CarCopy:MakeJoints() end end RespawnCarsBlock.Touched:connect(RespawnCars())
It's Parent
not parent
. Lua is Case Sensitive.
Also, your :Connect line on the button calls the function instead of binding it. (That'll error.) Remove the extra () inside of the :Connect(FunctionName())