Interaction¶
This page documents hooks in the interaction category.
CanPlayerHoldObject(client, entity)View Source
Purpose
Determines whether the hands weapon may pick up and hold a traced entity.
Category
Interaction
Realm
Server
Parameters
Player client The player attempting to hold the entity.
Entity entity The entity the player is trying to pick up.
Returns
boolean|nil Return true to explicitly allow holding or false to block it. Returning nil allows the default class and holdable checks to continue.
Example Usage
hook.Add("CanPlayerHoldObject", "liaExampleCanPlayerHoldObject", function(client, entity)
if entity:GetClass() == "prop_ragdoll" then
return false
end
end)
CanPlayerKnock(client, door)View Source
Purpose
Determines whether the hands weapon may perform its door-knock action on the traced door.
Category
Interaction
Realm
Server
Parameters
Player client The player attempting to knock.
Entity door The door entity being targeted by the knock action.
Returns
boolean|nil Return false to block the knock. Returning nil allows the default behavior to continue.
Example Usage
hook.Add("CanPlayerKnock", "liaExampleCanPlayerKnock", function(client, door)
if client:getNetVar("restrictedKnock") then
return false
end
end)