• [GMOD & HAMMER] any way to run lua script?
    2 replies, posted
  • hello there, i asked in the maps section, but they only answered me that gmod blocks the "point_clientcommand" from hammer. its accually pretty simple what i need.. there s an area in the map, if the player walks into it, takes the players X Y Z coords... then with lua i add 500 units to Z and port the player to the new given coords.. it does work with a concommand, when i type "move_to_top" ingame in console: [CODE]local trigger_up = Vector(0, 0, 768) function move_to_top(player, commands, args) if player:IsAdmin() or player:IsSuperAdmin() then player:SetPos(player:GetPos() + trigger_up) end end concommand.Add("move_to_top", move_to_top)[/CODE] but it wont let me trigger the concommand from hammer... any ideas ? thanks ! numu
  • Avatar of samm5506
  • There's a brush-based entity in Garry's Mod called 'lua_run'. Here's the source code for more detail on how it works. [url]http://glua.me/bin/?path=/gamemodes/base/entities/entities/lua_run/init.lua[/url] I've never used it personally, but I think all you need to do to get it working is pass a key 'RunCode' with the value being a single line of code.
  • [QUOTE]There's a brush-based entity in Garry's Mod called 'lua_run'. Here's the source code for more detail on how it works. [url]http://glua.me/bin/?path=/gamemodes/...a_run/init.lua[/url] [/QUOTE] that was it ! thanks! /SOLVED