So, I'm making an error screen in ScreenGui number 1 and the localscript in ScreenGui number 2. (btw this is at the bottom of the localscript) However, the repeat doesn't work. Code:
repeat
if workspace:FindFirstChild("Car") == nil then
print("car = nil")
wait(1)
if game:GetService("UserInputService").TouchEnabled then
script.Parent.Parent.screen.Frame2:TweenPosition(UDim2.new(0.216, 0,0.162, 0))
elseif game:GetService("UserInputService").KeyboardEnabled then
script.Parent.Parent.screen.Frame2:TweenPosition(UDim2.new(0.344, 0,0.3, 0))
end
end
wait(1)
until workspace:FindFirstChild("Car") == nil
I tried to destroy the car in test mode, but nothing came out, not even the print. There is no error in the output. No print either. Any help will be appreciated.

3 comments
you are basically saying (repeat check if car exist until the car exist), so when the car became nil, the repeat loop won't run anymore since it has met the requirements.
thanks this works
format