Fretta clientside issues

Two things.

1) Why is it that ply:GetRagdollEntity is so hugely delayed on my fretta gamemode as apposed to sandbox/non-fretta ones? I want to mess with a player’s ragdoll when they die (as I’ve done before) yet for other players, GetRagdollEntity is nil until about a second or two after you can clearly see it’s been created.

2) When playing online, on my own listen server, I can’t run anything from lua_run_cl. Not even simple print statements return anything. However, any other gamemode or in singleplayer it works just fine? Makes debugging harder and the general usefulness of being able to do that is nice.

This is just on the base laser dance gamemode with the laser dance part stripped out.

  1. Nope, works fine in Assassination as I use it for first person death
  2. sv_scriptenforcer 0, then change map.

It’s instant for my own ragdoll, but for other players when they die, ValidEntity(ply:GetRagdollEntity()) returns false until about a second and a half later.

cl_init.lua
[lua]function GM:Think()
for k, v in pairs(player.GetAll()) do
local rag = tostring(ValidEntity(v:GetRagdollEntity())); //false until about a second after that player dies
chat.AddText(v:GetName() … " " … rag);
end
end

local function DoRagdollMomentum(um)

local ply = um:ReadEntity();

timer.Simple(.1, function()
	if (ValidEntity(ply) && ValidEntity(ply:GetRagdollEntity())) then
		
		local rag = ply:GetRagdollEntity();
		//rag:Remove();
		for i = 0, (rag:GetPhysicsObjectCount() - 1) do
			rag:GetPhysicsObjectNum(i):ApplyForceCenter(Vector(0, 0, 10000));
		end

	end
end);

end
usermessage.Hook(“DoRagdollMomentum”, DoRagdollMomentum);[/lua]

init.lua
[lua]function GM:PlayerDeath(ply)

umsg.Start("DoRagdollMomentum")
	umsg.Entity(ply);
umsg.End()

end[/lua]

I can switch over to another gamemode I’ve made (not in fretta) that uses this same method and it works fine instantly for all death ragdolls. I’m doing this to carry over ragdoll momentum off of a player when he dies, so it needs to be as fast as it can be, and it’s just not working.