--[[
	Plays any relevant status related sound
]]

function VehicleSoundComponent:updateStatus(statusChanged)
	if statusChanged.Crashed and statusChanged.Crashed == true then
		local crashSound = CarSoundsFolder.Crashed[tonumber(math.random(1, 3))]:Clone()

		-- Parent then destroy it to play at that location
		crashSound.Parent = self.model.PrimaryPart
		crashSound:Play()
		Debris:AddItem(crashSound, 3)
	end

	if statusChanged.SharpTurn ~= nil then
		if statusChanged.SharpTurn == true and self.controller:getSpeed() > 80 then
			TweenService:Create(self.skid, tweenInfo, {Volume = 0.5}):Play()
		else
			TweenService:Create(self.skid, tweenInfo, {Volume = 0}):Play()
		end
	end

	if statusChanged.Boost ~= nil then
		if statusChanged.Boost then
			TweenService:Create(self.boost, tweenInfo, {Volume = 0.5}):Play()
		else
			TweenService:Create(self.boost, tweenInfo, {Volume = 0}):Play()
		end
	end
end

return VehicleSoundComponent
