Is there a problem with LocalPlayer():GetTool(), because everytime I run
lua_run_cl PrintTable(LocalPlayer():GetTool())
I get and error saying:
sandbox\gamemode\player_extension.lua:147: attempt to call method 'GetWeapon' (a nil value)
I am doing the exact thing that the wiki is doing and I still get an error.
Any help?
~Imp
You are right, this function is broken clientside and it should be fixed.
Can I ask what you need it for? We can certainly find a way around that.
I was using it so I can detect if someone is using the motor tool, I want to detect that so I can somewhat prevent that motor glitch to crash servers.
If that's what you want to do you can disable the use of toolmodes with [b][url=wiki.garrysmod.com/?title=Gamemode.CanTool]Gamemode.CanTool [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b].
Its not a gamemode script.
That changes nothing. :smile: You can use [b][url=wiki.garrysmod.com/?title=hook.Add]hook.Add [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] as shown in [b][url=wiki.garrysmod.com/?title=Gamemode.CanTool]Gamemode.CanTool [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]'s page to hook to gamemode events.
I need it Client side...Not Server side
You want to detect if *someone* wants to use the motor tool and forbid it? You have to do that serverside for it to be efficient. You could also do it clientside but that would imply you have a server sending them the script, so you might as well do it serverside to be sure they can't get past it.
Or I might have misunderstood you.
I am an admin on a server, I have a script(Yes it is a wall hack) to see players and I am adding in a feature to see the tool they have out so I can see if they are trying to use the motor tool and I can monitor that player to see if they are trying to use the motor glitch(It would mark the player on my screen).
I'm suprised that gettool outputs a table, but also, self.Owner:blah() is broken. Sometimes it works, others it doesn't. (On a per-loading of sandbox basis.)
I don't believe your current tool you have out is networked to other players. If you are an admin, you can write a script that can send the current tool to you.
[QUOTE=Gbps;22573972]I don't believe your current tool you have out is networked to other players. If you are an admin, you can write a script that can send the current tool to you.[/QUOTE]
Exactly. No other real way.
Sorry, you need to Log In to post a reply to this thread.