fix serdes

This commit is contained in:
EternityDev 2024-05-10 13:07:10 +07:00
parent 598c30c147
commit b4ee5dc1e3

View file

@ -20,13 +20,15 @@ return function(Identifier: string, timeout: number?): number
task.spawn(yieldThread, nil) task.spawn(yieldThread, nil)
error(`Serdes: {Identifier} is taking too long to retrieve, seems like not replicated on server.`, 2) error(`Serdes: {Identifier} is taking too long to retrieve, seems like not replicated on server.`, 2)
end) end)
while coroutine.status(cancel) ~= "dead" and task.wait(0.5) do -- let it loop for yields! task.spawn(function()
if (Event:GetAttribute(Identifier)) then while coroutine.status(cancel) ~= "dead" and task.wait(0.5) do -- let it loop for yields!
task.cancel(cancel) if (Event:GetAttribute(Identifier)) then
task.spawn(yieldThread, Event:GetAttribute(Identifier)) task.cancel(cancel)
break task.spawn(yieldThread, Event:GetAttribute(Identifier))
break
end
end end
end end)
return coroutine.yield() -- yield return coroutine.yield() -- yield
end end
return Event:GetAttribute(Identifier) return Event:GetAttribute(Identifier)