• lua_run entity, run by steam ID
    4 replies, posted
Basically I have a cow that runs through my entire map by activating a switch. I'd like this to be only activated by me, though, if possible through steam id. How would one do this with lua_run? I know it's a mapping question, but it's more lua related. (Can you move this to newbie questions, this might be better there actually.)
[QUOTE=Redcow17;24217046]Basically I have a cow that runs through my entire map by activating a switch. I'd like this to be only activated by me, though, if possible through steam id. How would one do this with lua_run? I know it's a mapping question, but it's more lua related. (Can you move this to newbie questions, this might be better there actually.)[/QUOTE] Some infos about this entity: - The lua entity takes up to 512 chars and no enters or taps. - I runs a one line code and using ", \" or \' will not work and could brake the VMF file. - If you want to use string, use ' to quote it. - To use Quotation marks in strings use [b][url=http://wiki.garrysmod.com/?title=String.format]String.format [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]. - The limits is set by the hammer editor and by the VMF format, not in gmod, so no way to bypass it. - A lua entity run code server side only and one of it is like one singel lua file in the autorun/server/ folder. - It has to be triggered to run.
You cannot restrict it to only you. People can easily bypass it.
Prefix your code with: [lua]if(not IsValid(activator) or not activator:IsPlayer() or activator:SteamID() ~= "your steamid") then return end[/lua] It wouldn't be hard to bypass it as an admin though.
[QUOTE=commander204;24235849]You cannot restrict it to only you. People can easily bypass it.[/QUOTE] I mean you can't do more chars in one entity than 512, if you need more you will need to use global functions and more lua_run entitles.
Sorry, you need to Log In to post a reply to this thread.