diff --git a/parts/player/init.lua b/parts/player/init.lua index f5cd63ce..d109f719 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -410,6 +410,7 @@ function PLY.newRemotePlayer(id,mini,p) P.uid=p.uid P.sid=NET.uid_sid[p.uid] P.group=p.group + P.netAtk=0 if not (P.group%1==0 and P.group>=1 and P.group<=6) then P.group=0 end _loadRemoteEnv(P,p.config) diff --git a/parts/player/player.lua b/parts/player/player.lua index 07e4d40a..6c1eb752 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -2605,6 +2605,13 @@ local function update_streaming(P) local line=int(event/0x100000000)%0x10000 for _,p in next,PLY_ALIVE do if p.sid==sid then + P.netAtk=P.netAtk+amount + if P.netAtk~=P.stat.atk then + MES.new('warn',"#"..P.uid..' desynchronized') + NET.player_finish({foo=""}) + P:lose(true) + return + end P:attack(p,amount,time,line,true) P:createBeam(p,amount) break