• Targeting the player via lua_run entity
    2 replies, posted
Hello guys, I've been now doing some mapping for my gamemode, and I've stumbled upon a decision Basically i want to give weapons to the player from button, which the player must press to receive them. There is 2 ways of doing this - either by spawning the weapons in the map itself, or using lua command via lua_run entity. But the lua_run entity does not get player info, thus the only way is by Entity( 1 ) which is useless in multiplayer gamemode. So are there any other ways of targeting the player that pushed the button and then giving him the weapons via lua_run? Thanks
A) Make a logic_auto triggering a lua_run that lets you add a playeruse hook to the map button (probably easiest and most reliable) B) Get closest entity that is looking at the button (Not really reliable) C) you can probably pass the players entity index into the lua_run, but I forgot most about entity I/O since I haven't done anything with it recently Those are my thoughts on approaching it
so ill do the hook.Add and target the func_button entity by a statement? (if ent == ents.FindByName ... ) ?
Sorry, you need to Log In to post a reply to this thread.