How to restrict Fading door tool in DarkRP ?


Have a problem with my Fading Door Tool on my Gmod server.
Players can use it on cars.
How can i stop that ?

Hook CanTool, check if the tool is fading_door, and check if the trace entity is the car. Return false if it is, otherwise return true.

Unless DarkRP is a special case; I’ve never done anything for it.

hook.Add("CanTool", "Fading_Door_Deny", function(ply, tr, tool)
    if tool == "Your tool name" and tr.Entity:IsVehicle() and !(ply:IsAdmin() or ply:IsSuperAdmin()) then
        return false

Replace “Your Tool Name” with whatever your fading door stool is called.

Edit: RIP, too slow.

Hey thanks for your help :slight_smile:

Im a total newbie too this
where do i but that code. Do i make a new lua file and put it in my lau/autorun/ or how ?

yep, put it on your