Hey it's me again, "the meme" But..... I need to know where to put this
function CheckTool(ply, trace)
local ent = trace.Entity
if IsValid(ent) and ent:IsPlayer() then
return false
end
end
hook.Add("CanTool", "PreventPlayerTooling", CheckTool)
It's from the link:[url]https://facepunch.com/showthread.php?t=1297821&highlight=materialize[/url]
And it shows the resolution but it does show me where to put it
Also on a side note, if that doesn't work does anyone know why users can materialize people?
It should be a FPP option under toolgun settings such as players can toolgun blocked/world entities
mixing up autorun with addons folder=next level
The thread said run serverside. lua/autorun/server. Also, the code can be condensed to
[code]hook.Add("CanTool", "PreventPlayerTooling", function(_, tr)
if (tr.Entity:IsPlayer()) then
return false
end
end)[/code]
[QUOTE=code_gs;50608665]The thread said run serverside. lua/autorun/server. Also, the code can be condensed to
[code]hook.Add("CanTool", "PreventPlayerTooling", function(_, tr)
return not tr.Entity:IsPlayer()
end)[/code][/QUOTE]
If you want to break every other CanTool hook, yes.
[QUOTE=man with hat;50608741]If you want to break every other CanTool hook, yes.[/QUOTE]
Oops! Hook returns just slipped my brain for a second; fixed.
[QUOTE=code_gs;50608665]The thread said run server side. Lua/autorun/server. Also, the code can be condensed to
[code]hook.Add("CanTool", "PreventPlayerTooling", function(_, tr)
return not tr.Entity:IsPlayer()
end)[/code][/QUOTE]
Thanks code_gs Big fan, (I'm Randy Butternubs Former Mod from SUP) But I don't quite understand, Yes that's a code but.... what lua file would I put it in??? Or like what would I do with it (My IQ is .1 :cry:)
You can put in a new Lua file if you don't have one for your custom code already. garrysmod/lua/autorun/server/toollimit.lua for example. Anything lua file in autorun will be automatically executed.
[QUOTE=code_gs;50608923]You can put in a new Lua file if you don't have one for your custom code already. garrysmod/lua/autorun/server/toollimit.lua for example. Anything lua file in autorun will be automatically executed.[/QUOTE]
Oh ok, thanks :v::goodjob:
[editline]28th June 2016[/editline]
[QUOTE=code_gs;50608923]You can put in a new Lua file if you don't have one for your custom code already. garrysmod/lua/autorun/server/toollimit.lua for example. Anything lua file in autorun will be automatically executed.[/QUOTE]
Also I'm not sure If I should just put this in a new thread but... I been wanting to know this for a long time, and that is that if there is a way to check if your FastDL is working (Not the workshop FastDL) Because I have the resouceaddfiles.lua in the lua/autorun/server but still I don't think it's working Thanks!:smile::smile:
[QUOTE=DavyDev;50609004]Oh ok, thanks :v::goodjob:
[editline]28th June 2016[/editline]
Also I'm not sure If I should just put this in a new thread but... I been wanting to know this for a long time, and that is that if there is a way to check if your FastDL is working (Not the workshop FastDL) Because I have the resouceaddfiles.lua in the lua/autorun/server but still I don't think it's working Thanks!:smile::smile:[/QUOTE]
Can you post your server.cfg?
[QUOTE=code_gs;50609044]Can you post your server.cfg?[/QUOTE]
I sent you it through PM
How I check is I delete all my local resource downloads and connect to the server and make sure I have all of the models.
[QUOTE=danker pepers;50609458]How I check is I delete all my local resource downloads and connect to the server and make sure I have all of the models.[/QUOTE]
Ok! I'll make sure to try that, thanks!
Sorry, you need to Log In to post a reply to this thread.