Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Please help me on line 7?

Asked by 10 years ago

local respawnCarsBlock = Game.Workspace.RespawnCarsBlock

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

01for_, object in pairs(game.ServerStorage:GetChildren()) do
02    print(object.Name)
03    if object.Name == "Car" then
04        print("This is a car! We need to destory it!")
05        object:Destory
06    end
07end
08 
09for_, object in pairs(game.ServerStorage:GetChildren()) do
10    local carCopy = object:Clone()
11    carCopy.Parent = Game.Workspace
12    carCopy:MakeJoints()
13end

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

0
line 7 just says end NinjoOnline 1146 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

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.

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

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

1-- the wrong one
2object:Destory
3-- wat
1-- correct one
2object:Destroy()
0
Now it is saying there is something wrong with line 18... Natsu2211 0 — 10y
Ad

Answer this question