-
Notifications
You must be signed in to change notification settings - Fork 7
Feature/add crucify #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature/add crucify #116
Conversation
ulx.unragdollPlayer( ply ) | ||
end | ||
|
||
if IsValid( cross ) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use SafeRemoveEntity
here
end | ||
|
||
local rightHandID = playerRagdoll:LookupBone( "ValveBiped.Bip01_R_Hand" ) | ||
local leftHandID = playerRagdoll:LookupBone( "ValveBiped.Bip01_L_Hand" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gets the bone index of the given bone name, returns nothing if the bone does not exist.
These can error on models that don't have said bones, custom models from pac, outfitter w/e can cause this. Make sure to account for that.
local phys_obj = playerRagdoll:GetPhysicsObjectNum( 1 ) | ||
local boneID = 2 | ||
|
||
while IsValid( phys_obj ) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a for loop in here, a error in any of this could lead to a crash
|
||
cmd.uncrucifyPlayer( prop.crucifiedPly ) | ||
end | ||
hook.Add( "EntityRemoved", "CFC_ULX_CrucifyRemoveProp", uncrucifyOnRemove ) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to add a newline at the end of files
ply.ragdoll:DisallowDeleting( false ) | ||
ply.ragdoll:Remove() | ||
end | ||
if IsValid( ply.cross ) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use SafeRemoveEntity
here
local leftHandID = playerRagdoll:LookupBone( "ValveBiped.Bip01_L_Hand" ) | ||
|
||
local rightHandPhys = playerRagdoll:TranslateBoneToPhysBone( rightHandID ) | ||
local leftHandPhys = playerRagdoll:TranslateBoneToPhysBone( leftHandID ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take note of that. Thank you |
Adds a command to crucify targets & it's opposite.