Horse despawning system not working?

Made a horse spawning system. It works. You can buy horses, you can spawn horses. But you can’t despawn.

I have 0 errors, and it’s all printing correctly except for the pcall.

To clear stuff up and for context:

  1. I have made a folder for “SpawnedHorses”
  2. When a player joins, a folder with their name is inserted into “SpawnedHorses”
  3. The dismount event is for them to be removed from the horse, or else they will be stuck in a weird seat position.

Script here:

SpawnHorseEvent.OnServerEvent:Connect(function(plr, HorseName, Command)
	print("Horse Event") --Prints
	local OwnHorse = DoTheyOwnTheHorse(plr, HorseName)
	if Command == "Despawn" then
		print("Despawn") --Prints
		print(workspace.SpawnedHorses:FindFirstChild(plr.Name):GetChildren()) --Prints children
		for i,v in pairs(workspace.SpawnedHorses:FindFirstChild(plr.Name):GetChildren()) do
			 success,errorm = pcall((function()
				Dismount = v:FindFirstChild("Horse").Dismount:InvokeClient(plr) --Checks if they can dismount
			end))
			if success then
				if Dismount == true then
					v:Destroy()
				end
			else
				v:Destroy()
			end
		end
		print(success,errorm) --This does not print

	elseif Command == "Spawn" then
		print("Spawn")
		if OwnHorse == true then
			MoveTheHorseToThem(plr, HorseName)
		end
	end
end)

I’ve already ruled out that the server sees the horse, but I don’t know why it’s not printing.

Is it because of the fact that the client isn’t returning yet and it’s doing it’s own version of infinite yield? (If that’s a possibility.) Anyway, help would be nice.

I believe you need a local before success and errorm?

I did a local before, just removed it, lemme add it back, but it shouldn’t change anything.

Okay so I found the error. It was essentially an infinite wait for the dismount, gonna try and fix it. Thanks tho.