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

Car Spawner Is not working!?!

Asked by
Danfly 5
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Whenever I have modeled this script with the brick and my car together it just regens every 5 sec instead of till the car is off. How do I fix it?

local car = script.Parent.Parent.Car:Clone()

while true do 

    wait(5)


    local n = script.Parent.Parent:FindFirstChild("Car") == nil
    if (n or (script.Parent.Position - script.Parent.Parent.Car.VehicleSeat.Position).magnitude > 40) then
        if (n ~= true) then
            script.Parent.Parent.Car.Parent = game.Workspace
        end
        local c = car:Clone()
        c.Parent = script.Parent.Parent
        c:makeJoints()
    end

end

Answer this question