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.")

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

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.

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()
0
Now it is saying there is something wrong with line 18... Natsu2211 0 — 10y
Ad

Answer this question