New Wiremod class for DarkRP - Help plz

So ive made a new class for DarkRP, called an electrician.

I want this to be the ONLY class to be able to use wiremod and pctools, does anyone know how i would go about this.

[lua] function WireRestriction( ply, tr, toolmode )
if string.find(toolmode, “wire”) then
if ply:Team() == TEAM_ELECTRICIAN then – add or ply:IsAdmin() if you want admins to be able to use them anyway
return true
else
return false
end
end
end

hook.Add( “CanTool”, “WireRestriction”, WireRestriction)[/lua]

Not tested but that should work.

Thanks for quick response, but where do i add this to. Im not very good at all with lua.

Anywhere serverside. So it could be at the end of the init/main.lua of your DarkRP, or just in garrysmod/lua/autorun/NameMe.lua

To save as lua just use notepad and save as .lua

Thanks works perfectly. Is it possible to block the physics panel in wiremod completely though.

[editline]06:24PM[/editline]

And how about the PCTools as well.

[editline]08:08PM[/editline]

Ye i really need the physics panel blocked out, because people just kill eachother.

Also, if its possible it would be great to have a a way of giving the contraptions made to someone else because if this class leaves we dont want the stuff he has made for someone else do dissapear.