Error 'TriggerServerEventInternal'

Hi I have an issue with some code i have written, it throws this error in the client:


I cannot figure this out any clue community?
here is my code:
(client)

Citizen.CreateThread(function()
	Citizen.Wait(1000) -- loops every second
	while not adminUser do
		TriggerServerEvent("yt:model-restriction:getRole")
		if originalModel == "" then
			originalModel = GetEntityModel(ped)
		end
		if originalModel ~= originalModel then

(server)

RegisterServerEvent("yt:model-restriction:getRole")
AddEventHandler("yt:model_restriction:getRole", function()
	ped = GetPlayerIdentifiers(source)[1]
	for i=1, #playerRank do
		if ped == playerRank[i].ID then
			TriggerClientEvent("yt:model_restriction:receiveRole", source, playerRank[i].rank)
		else
			TriggerClientEvent("yt:model_restriction:receiveRole", source, "User")
		end
	end
end)

It creates the same issue on FX and CFX server

Your Wait is on a wrong line and you probably ended up with an infinite loop.

Good spot thanks

Char limit fill