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

Please help me on line 7?

local respawnCarsBlock = Game.Workspace.RespawnCarsBlock

function respawnCars() print("I am going to respawn the cars now.")

for_, object in pairs(game.ServerStorage:GetChildren()) do
	print(object.Name)
	if object.Name == "Car" then
		print("This is a car! We need to destory it!")
		object:Destory
	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)

local redLight = Game.Workspace.StartLight.RedModel.LightBulb.PointLight local yellowLight = Game.Workspace.StartLight.YellowModel.LightBulb.PointLight local greenLight = Game.Workspace.StartLight.GreenModel.LightBulb.PointLight local startBarrier = Game.Workspace.StartBarrier

wait(5)

redLight.Enabled = true

wait(1)

redLight.Enabled = false yellowLight.Enabled = true

wait(1)

yellowLight.Enabled = false greenLight.Enabled = true startBarrier.Transparency = 1 startBarrier.CanCollide = false

On line 7.... The word "in" is highlighted red

1 comment

0

line 7 just says end

1 answer

✓ Accepted answer

There are a few errors here. There's nothing wrong with line 7. However, on line 1 and 9, I believe you need a space between "for" and "_", although that could just be my habits.

for _, object in pairs(game.ServerStorage:GetChildren()) do

On line 5, you misspelled destroy and forgot to add the parentheses.

-- the wrong one
object:Destory
-- wat
-- correct one
object:Destroy()

1 comment

0

Now it is saying there is something wrong with line 18...

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