• NPC Flasher
    5 replies, posted
can you make a SWep, that Flashes NPC, so they are blinded in fx. 5-10 sec. ? it could be awesome to use, in Sandbox :) or maybe a GasGrenade.. just like the smoke, but when you enter the Smokescreen you will lose life, slowly ? (like the NOVA GAS in Black Ops)
You think about a Grenade, which disables AI of NPC's in range of x units? I don't think this is possible. @EDIT But, maybe change npc's relations to neutral could do the trick.
[QUOTE=mariosuchy;26449154]You think about a Grenade, which disables AI of NPC's in range of x units? I don't think this is possible. @EDIT But, maybe change npc's relations to neutral could do the trick.[/QUOTE] maybe you are right... :(
Check if it's in range, if not do nothing, if it is run ai_enabled 0. then create a timer, and after 30 seconds run ai_enabled 1 [editline]3rd December 2010[/editline] [b][url=http://wiki.garrysmod.com/?title=Ents.FindInSphere]Ents.FindInSphere [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] [editline]3rd December 2010[/editline] you could try something like this..probably wrong though [lua] for k, v in ipairs(ents.GetAll()) do if v:IsNPC() then local NPC = ents.FindInSphere(Vector(v:GetPos()), 30) if NPC then RunConsoleCommand("ai_enabled", "0") timer.Simple(30, function() RunConsoleCommand("ai_enabled", "1") end) else return end end end end[/lua] Something like that maybe
That would only work in single player and disable all npc's.
Yeah I know, I'm just trying to give suggestions. [editline]3rd December 2010[/editline] oh and also if you are going to come up with something using a variation of the method I posted you should use [lua]local NPC = ents.FindInSphere(Vector(self:GetPos()), 30)[/lua] not [lua]local NPC = ents.FindInSphere(Vector(v:GetPos()), 30)[/lua] I think that self:GetPos works not sure though
Sorry, you need to Log In to post a reply to this thread.