Ulysses

General => Developers Corner => Topic started by: GeorgeHennen on July 13, 2018, 01:33:57 PM

Title: What would this line do
Post by: GeorgeHennen on July 13, 2018, 01:33:57 PM
Code: [Select]
hook.Add("PlayerSpawn", "_ply_physgungrab", function(ply)
    if ply._ulx_physgun then
        if ply._ulx_physgun.b and ply._ulx_physgun.p then
            timer.Simple(0.001, function()
                ply:SetPos(ply._ulx_physgun.p);
                ply:SetMoveType(MOVETYPE_NONE);
            end);
        end
    end
end)

I've recently downloaded a ULX right click when holding down on a player with a physgun to freeze script and that code seems fishy.
Title: Re: What would this line do
Post by: iViscosity on July 13, 2018, 02:07:07 PM
I don't know what the _ulx_physgun field on the player is, but if I had to guess, it makes it so when a player spawns if that field is not nil, it sets their location to _ulx_physgun.p and then freezes them (MOVETYPE_NONE means no moving)

So in the context of the add-on, I'd guess that it prevents people from killing themselves to get out of being frozen by resetting their position after spawning.