Hello there!
[B]For the past days I have been trying to a script that enables me to be able to press the use key on a player's ragdoll to run another task. I have had no success in my multiple attempts so I have turned to the forums.[/B]
If someone could solve my problem for me it would be much appreciated :)
Can you go into more depth on what you mean? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerUse]GM:PlayerUse[/url] exists for doing things after a player uses another entity.
[QUOTE=code_gs;51775142]Can you go into more depth on what you mean? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerUse]GM:PlayerUse[/url] exists for doing things after a player uses another entity.[/QUOTE]
As far as I know PlayerUse only works on already usable entities.
I am using KeyPress hook for things like this.
[QUOTE=code_gs;51775142]Can you go into more depth on what you mean? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerUse]GM:PlayerUse[/url] exists for doing things after a player uses another entity.[/QUOTE]
Yes thats exactly what I mean
[editline]4th February 2017[/editline]
[QUOTE=uRandomAlex;51775155]As far as I know PlayerUse only works on already usable entities.
I am using KeyPress hook for things like this.[/QUOTE]
Ok then how would I make a players ragdoll a useable entity
Dead player ragdolls are clientside only by default, you will have to hide the original and create a serverside ragdolls first before you can do what you want, just like TTT.
[QUOTE=Robotboy655;51775360]Dead player ragdolls are clientside only by default, you will have to hide the original and create a serverside ragdolls first before you can do what you want, just like TTT.[/QUOTE]
They wont be dead. Ill be running the [URL="http://https://wiki.garrysmod.com/page/Player/CreateRagdoll"]Player:CreateRagdoll[/URL] function on them before I want the Use key to be useable on them.
Yes, which will create a ragdoll on each client and not on the server.
[QUOTE=Robotboy655;51775403]Yes, which will create a ragdoll on each client and not on the server.[/QUOTE]
Sorry I'm quite new to scripting but something has me confused.
On the Gmod wiki the function is referenced as blue which means its serverside, but what your saying is its clientside.
Could you explain this to me?
[QUOTE=Ben Farlow;51775408]Sorry I'm quite new to scripting but something has me confused.
On the Gmod wiki the function is referenced as blue which means its serverside, but what your saying is its clientside.
Could you explain this to me?[/QUOTE]
The function internally creates a networked entity serverside that is then sent to every client, similar to what running `ents.Create()` does.
[QUOTE=Ben Farlow;51775408]Sorry I'm quite new to scripting but something has me confused.
On the Gmod wiki the function is referenced as blue which means its serverside, but what your saying is its clientside.
Could you explain this to me?[/QUOTE]
The realm indicator on the wiki only tells you in which realms this function is defined, not upon which realm it acts. Take [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Broadcast]net.Broadcast[/url] as an example. The function exists only in the server realm, however it's effects only act upon the client realm.
[QUOTE=James xX;51775905]The realm indicator on the wiki only tells you in which realms this function is defined, not upon which realm it acts. Take [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Broadcast]net.Broadcast[/url] as an example. The function exists only in the server realm, however it's effects only act upon the client realm.[/QUOTE]
Thank you very much, I understand now.
Sorry, you need to Log In to post a reply to this thread.