From 5c4ebc932d8c02522802c842d43d863d89aca162 Mon Sep 17 00:00:00 2001 From: Apickx Date: Mon, 28 Dec 2015 19:10:44 -0500 Subject: Initial commit --- gamemode/shared/synchronize.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 gamemode/shared/synchronize.lua (limited to 'gamemode/shared/synchronize.lua') diff --git a/gamemode/shared/synchronize.lua b/gamemode/shared/synchronize.lua new file mode 100644 index 0000000..126c616 --- /dev/null +++ b/gamemode/shared/synchronize.lua @@ -0,0 +1,22 @@ + +if (SERVER) then + util.AddNetworkString("LoadEntity_WS") + + net.Receive("LoadEntity_WS",function(siz,pl) + local Ab = net.ReadEntity() + + if (Ab:IsPlayer()) then + Ab:UpdateSelection(pl) + --pl:UpdateStream(Ab) + end + end) +else + local Q = 0 + function GM:NetworkEntityCreated(ent) + Q=Q+1 + timer.Simple(math.Rand(0.1,0.2)*Q,function() + net.Start("LoadEntity_WS") net.WriteEntity(ent) net.SendToServer() + Q=Q-1 + end) + end +end \ No newline at end of file -- cgit v1.2.3-70-g09d2