• ENT:Use() clientside
    5 replies, posted
Why is ENT:Use() serverside only? I need a 2d3d button on an entity to change colors when someone uses the entity and I can't because it's just a mystery to the client whether or not they succeeded in using something. Does anyone know a way around this that doesn't involve net messages or NWBools?
Use net messages
[QUOTE=gonzalolog;51419294]Use net messages[/QUOTE] That's probably what I'll have to wind up doing. Who would make ENT:Use() serverside only? Why? It doesn't make sense to me.
[QUOTE=a1steaksa;51419479]That's probably what I'll have to wind up doing. Who would make ENT:Use() serverside only? Why? It doesn't make sense to me.[/QUOTE] Imagine an entity that gives you a secret, or the next stage in a puzzle, and all you would have to do to get that secret is press enter, along with a few other conditions you want to keep secret. The conditions would have to be serverside, to make sure players aren't cheating their way into pressing the button.
[QUOTE=James xX;51419542]Imagine an entity that gives you a secret, or the next stage in a puzzle, and all you would have to do to get that secret is press enter, along with a few other conditions you want to keep secret. The conditions would have to be serverside, to make sure players aren't cheating their way into pressing the button.[/QUOTE] Then you just keep the secret logic on the server...? Just because a hook is shared doesn't mean everything about it is exposed to the client. That's like saying [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnPlayerChat]GM:OnPlayerChat[/url] shouldn't exist because if you wanted a secret phrase, the client could cheat and know that phrase. Well if you wanted it to be a secret, why did you put the secret phrase on the client and not do it on the server with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerSay]GM:PlayerSay[/url] in the first place? I'm guessing here, but ENT:Use is serverside only probably because that's just how it is in the engine.
[QUOTE=James xX;51419542]Imagine an entity that gives you a secret, or the next stage in a puzzle, and all you would have to do to get that secret is press enter, along with a few other conditions you want to keep secret. The conditions would have to be serverside, to make sure players aren't cheating their way into pressing the button.[/QUOTE] You can split server and client functions just fine. I literally just want to set a variable to CurTime clientside when the player uses the entity without having to use net messages and other otherwise unnecessary workarounds.
Sorry, you need to Log In to post a reply to this thread.