I have a piece of code that is supposed to run 2 functions at the same time. I used task.spawn() to try and run these two functions but only the top one runs. (dont worry about the while loops being empty, the code i have works fine, but it seems like threads are off or something)
function headtailSequence()
local headlight = car.Body.Headlight.G1
local tweeninfo = TweenInfo.new(0.25, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
while switched do
end
end
function sequence()
local iterations = 0
local sequence_num = 1
while switched do
end
end
F.Switch = function(s)
switched = s
if s then
task.spawn(headtailSequence())
task.spawn(sequence())
end
end
when the F.Switch functon is called it is supposed to make both sequences happen at the same time, but when testing it in studio, it doesn’t work.