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