garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

RemoveInternalConstraint invalid on ClientSideRagdolls

Open riftkan opened this issue 3 years ago • 1 comments

Details

64 bit chromium & none branch

Running RemoveInternalConstraint on a clientside ragdoll throws an error attempt to call method 'RemoveInternalConstraint' (a nil value)

Steps to reproduce

util.PrecacheModel("models/player/breen.mdl")

concommand.Add("csrag", function(ply)
	if SERVER then return end
    local trace = LocalPlayer():GetEyeTrace()
    local ragdoll = ClientsideRagdoll("models/player/breen.mdl")
    ragdoll:SetNoDraw(false)
    ragdoll:DrawShadow(true)
    ragdoll:SetPos(trace.HitPos)
    ragdoll:RemoveInternalConstraint(5)
end)

riftkan avatar Feb 02 '22 09:02 riftkan

Because ClientsideRagdoll doesn't return an entity which can use Entity:RemoveInternalConstraint function. Clientside entities have fewer capabilities than those created by the server, in short this is not a bug.

FlorianLeChat avatar Feb 02 '22 10:02 FlorianLeChat

The function is serverside only.

Duplicate of https://github.com/Facepunch/garrysmod-requests/issues/2328

robotboy655 avatar May 07 '24 10:05 robotboy655