Physc gun touch other props.

Hello,

Am having problem here…
How do can i set for ranks to be able touch everyone prop ? For exapmle for moderator rank. Using ULX i can set only player physc gun.

Sorry for mah bad english spelling… hope you get what i meant :frowning:

GM/PhysgunPickup

Return true if the player is a certain rank or owner of the prop.

So and how do i make it for props and moderator rank ?

Do what Greetings said, in conjunction with the

Player:IsUserGroup function.

This : ?



function PlayerPickup( ply, ent )
	if Player:IsUserGroup() and ent:GetClass():lower() == "moderator" then
		return true
	end
end
hook.Add( "PhysgunPickup", "Allow Prop Pickup", PropPickup )


No, check if the user group is “moderator” and the ents class is a prop

[editline]11th April 2015[/editline]

also, you haven’t defined what"Player" is

Now am confused… isnt that only for player pickup ?

What are you on about???

That Moderator rank can pickup other player props and remove them

It doesn’t matter what the function is called -_-



function PlayerPickup( ply, ent )
    if ply:IsUserGroup( "moderator" ) and ent:GetClass() == "prop_*" then
        return true
    end
end

hook.Add( "PhysgunPickup", "Allow Prop Pickup", PropPickup )


I think that should work…

How can people be this dumb.

As stated before, but obviously ignored, Player isn’t defined.

What is going on in this thread

  1. Localize your functions if you’re not calling them outside that file.

  2. Player isn’t defined. ply is.



local function modpickup( ply, ent )
    if (ply:IsUserGroup( "moderator" ) and ent:GetClass() == "prop_*") then
        return true
    end
end

hook.Add( "PhysgunPickup", "moderator_allowpickup", modpickup )


And here’s how to make them be able to toolgun things



local function modtool( ply, tr, tool )
    if (ply:IsUserGroup( "moderator" ) and tr.Entity and tr.Entity:GetClass() == "prop_*") then
        return true
    end
end


hook.Add( "CanTool", "moderator_allowtoolgun", modtool )


Useful for learning how to Lua
A more in depth tutorial series
The Holy Grail of getting into Lua

Still cMod cant move other props

What are the exact names of your user groups?

superadmin/admin/moderator/vio/trusted/user(default)