• Detect SteamID in a map via lua_run
    14 replies, posted
Hello I currently try to detect a SteamID in my map by running a lua_run entity on map start. I thought that if the ID is detected, another entity could be executed, but I realised that this does not work. So I tried running a simple ifthen: if Player:SteamID()=='STEAM_0:1:23456789' then print('hello') end But that does not work, because 'Player' needs a function. So I tried this: function detect(ply) if ply:SteamID()=='STEAM_0:1:23456789' then print('hello') endend And I wouldn't open this thread, if this function would work. My question is: How can I fix that?
Wait, so you want to create a map that executes a specific feature just for one specific steam user?
I thought it would be interesting to test this and see what you can do since I found the 'lua_run' class in Hammer.
It's entirely possible, TTT_Nuclear_Power_V4_fix uses the method in multiple areas. Example: if ACTIVATOR:IsPlayer() and ACTIVATOR:SteamID() == 'STEAM_0:1:15344052' then  for _, x in pairs(ents.FindByClass('logic_relay')) do  if x:GetName() == 'steamid_check_1_relay' then  x:Fire('Trigger')  end  end  end This is achieved by firing a trigger at a lua_run, that passes the player in as ACTIVATOR. You can also just do operations on all players: for _, p in pairs ( player.GetAll() ) do  if p:GetRole() == ROLE_INNOCENT then  p:Kill()  end  end
So I tried out the code and ran into the problem that there was no error and no output if ACTIVATOR:IsPlayer() and ACTIVATOR:SteamID() == 'STEAM_0:0:49375502' then for _, x in pairs(ents.FindByClass('ttt_game_text')) do if x:GetName() == 'detection' then x:Fire('OnUser1') end end end I try to display this through the 'ttt_game_text' entity, but I think the trigger is the wrong one (There is only 'OnUser1' to 'OnUser4' available) The workflow is: ttt_map_settings -> lua_run -> ttt_game_text
Is this TTT map?
Don't do this.
yes it it. But I can try
what for?
then go ahead
Maybe using it in later maps for little secrets. I thought that detecting the SteamID is the easiest way to test lua_run
Just use a trigger_multiple to activate the lua_run, that's the "easiest" way. I only know this stuff because I've gone out of the way and written a Lua script that removes a bunch of this STEAMID checking secret stuff from maps for my server.
As long as you don't try using the SteamID check for secret backdoors inside of the map go ahead... But I would also suggest using the trigger_multiple mentioned by @Glitchvid if you want to do secrets.
FEDEREALS BACKDOOR INVESTIGATIONS, OPEN UP
Next generation of a backdoors. Lua scripts are so 2018. https://files.facepunch.com/forum/upload/112701/0b2b9121-13bc-4cd5-a0fd-4581e72cf9e7/wesmart.png
Sorry, you need to Log In to post a reply to this thread.