Update Serdes.luau - Client infinite yield warning

Added a warning for yielding identifiers on the client. (10s)
This commit is contained in:
xArshy 2024-03-28 14:30:00 +04:00 committed by GitHub
parent 5cf44bd21f
commit 51a51f66cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,9 +15,18 @@ return function(Identifier: string): number
--Event:SetAttribute(Identifier, string.pack("I1", SerInt)) -- I1 -> 255 max, I2 -> ~ 6.5e4 max. (SerInt) --Event:SetAttribute(Identifier, string.pack("I1", SerInt)) -- I1 -> 255 max, I2 -> ~ 6.5e4 max. (SerInt)
end end
else else
local loaded = false
task.delay(10, function()
if loaded then
return
end
warn(`{Identifier} is taking too long to load on the server.`)
end)
while not Event:GetAttribute(Identifier) do while not Event:GetAttribute(Identifier) do
task.wait(0.5) task.wait(0.5)
end end
loaded = true
end end
return Event:GetAttribute(Identifier) return Event:GetAttribute(Identifier)
end end