Hello. I am working on the following:
if SERVER then
hook.Add( "PlayerUse", "DisallowInteract", function( ply )
if ply:GetActiveWeapon():GetClass() == "someweapon" then
return false
end
end )
end
The purpose is to stop players from interacting with doors, buttons, etc. Whenever they try to switch sweps, it doesn't let them switch sweps. Help is appreciated.
Is this DarkRP?
It's derivative of DarkRP
hook.Add( "PlayerUse", "Interact", function(ply, ent)
if ply:GetActiveWeapon():GetClass() == "weapon" then
return false
end
end)
The problem is that people can't switch weapons when PlayerUse returns false. They can't interact with buttons and stuff which is intended, but I need them to be able to switch weapons. Is this possible?
Sorry, you need to Log In to post a reply to this thread.