• Using GM:SetupMove (or any hook for that matter) to Control a Player's Direction
    0 replies, posted
Hey guys, I'm trying to use SetupMove in an effort for one player to control another's movement. Now, I am aware of how expensive this is in term's of the server's resources, but I would still like to get it working. So far, I've set it up to the point where if player1 fit's the neccessary requirements to move player 2, run a function. However, I'm not quite sure how to use SetupMove to control someone's movements. Basically, wherever player1 is, is where player2 should be dragged to when clicked e on. (Don't worry about distance between players, etc. I can add those in once I get a basic start on this. [code] hook.Add("PlayerBindPress", "disallowUseArrested", function(ply, bind) local allowPush = false if (string.find(bind, "+use")) then for k, v in pairs(handcuffs.Allow_Teams) do if team.GetName(ply:Team()) == v and not ply:GetNWBool("isHandcuffed") then allowPush = true end end local plyTouch = ply:GetEyeTrace().entity if allowPush and plyTouch:IsPlayer() and plyTouch:GetNWBool("isHandcuffed") then MovePlayer(ply, plyTouch) end end end) [/code] How would I go about setting up MovePlayer() which is hooked to SetupMove to control player2's movement.
Sorry, you need to Log In to post a reply to this thread.