I have here a modified cog from Phantom Coder (Hell Raiser) for my new mod, iv fixed one bug, the standing leg bug (where they stand over dead bodys).
But now.. theres a glitch when in idle mode. They show under the player.
Here is the cog:
Now how do i fix this?
Code tags, please. Quote tags just dont cut it...
But now.. theres a glitch when in idle mode. They show under the player.
Here is the cog:
Code:
# JK Cog Script
#
# legs.cog
#
# Have legs in first person
#
# Created by: PhantomCoder and modified by Xzero Phoenix to fix the "standing legs over dead body" issue (lol it was funny, the legs would be out in 3rd person and be standing over your dead body lol)
flags=0x240
symbols
thing Player local
model Player_Mdl local
template Legs_Tpl=legs local
thing Legs=-1 local
message startup
message pulse
message killed
end
# ========================================================================================
code
startup:
Player=GetLocalPlayerThing();
//Sleep while level loads
Sleep(0.25);
SetPulse(0.01);
return;
# ........................................................................................
pulse:
if(GetCurrentCamera() == 1)
{
if(Legs != -1)
{
DestroyThing(Legs);
Legs=-1;
}
return;
}
if(GetThingHealth(player) < 1)
{
if(Legs != -1)
{
DestroyThing(Legs);
Legs=-1;
}
return;
}
if(Legs == -1)
{
Player_Mdl=GetThingModel(Player);
//Legs=CreateThing(Legs_Tpl, Player);
Legs=FireProjectile(Player, Legs_Tpl, -1, -1, '0 0 0', '0 0 0', -1, -1, -1, -1);
SetThingModel(Legs, Player_Mdl);
AmputateJoint(Legs, 2);
AttachThingToThingEx(Legs, Player, 0x8);
}
else
{
SetThingVel(Legs, GetThingVel(Player));
SetThingLook(Legs, GetThingLVec(Player));
if(IsThingCrouching(Player))
{SetPhysicsFlags(Legs, 0x10000);}
else
{ClearPhysicsFlags(Legs, 0x10000);}
}
return;
# ........................................................................................
killed:
if(Legs != -1)
{
DestroyThing(Legs);
}
return;
# ========================================================================================
endNow how do i fix this?
Code tags, please. Quote tags just dont cut it...

Thanks for the mind-jog.