ULX

Author Topic: What would this line do  (Read 1448 times)

0 Members and 1 Guest are viewing this topic.

Offline GeorgeHennen

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
What would this line do
« 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.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 802
  • Karma: 58
Re: What would this line do
« Reply #1 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.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.