fix serdes

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

View file

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