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

parent is not a valid member of Model? plzz help

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())

1 answer

✓ Accepted answer

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())

4 comments

0

Thank you very much it worked Thank you RubenKan how can i +rep you

0

You could click the Accept Answer button on the bottom. V

0

i dont see it

0

it came up right after i rote "i dont see it"

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