#Grabbing a players SteamID inside a map?

1 messages · Page 1 of 1 (latest)

quaint ember
#

It possible? Something like... if player with SteamID 87654 enter's this trigger. KILL!!!

#

seems like it used to be possible in source1 with lua scripts

#source-1-dev message

https://www.youtube.com/watch?v=mraWsI7Apmo

With Vercas and BFG9000's (huge) help, I've managed to make a Lua script activated via "lua_run" entity from Garry's Mod's FGD.

If someone presses a button, it checks the !activator's SteamID (works only in Multi-player), and if it matches mine, the door opens.

Special thanks to Flynx_Master for recording the video. :p
If you want to use the ...

▶ Play video
#
hook.Add('PlayerUse', 'Button', function(ply,ent) if(ent:GetName()=='Button') then if(ply:SteamID()=='STEAM_0:0:36158367') then local doors = ents.FindByName('TestDoor') for j = 1, #doors do doors[j]:Fire('Open', 1) end end end end )
#
Replace Button with the func_button's name you want to use, STEAM_0:0:36158367 with the your SteamID, TestDoor with the entity's name whose input you want to fire, and Open with the input name. Remember to use 'string' in Hammer instead of "string", otherwise your .VMF will get corrupted. Also, don't abuse this to destroy the server you're playing on. :L
#

darn, i dont see the entity type: lua_run

#

source 2 sadge