• Helicopter NPC help
    4 replies, posted
Ok, Ive gotten the helicopter to spawn, and I set the relationship to each player to HATE, yet the helicopter doesn't fire. [lua] function SpawnHelicopter() print("Spawning a Heli.") SpawnPos = GetRandomPoint() + Vector(0, 0 , 1280) Helicopter = ents.Create("npc_helicopter") Helicopter:SetPos(SpawnPos) Helicopter:Spawn() for k, v in pairs(player.GetAll()) do Helicopter:AddEntityRelationship(player.GetByID(k), D_HT, 99 ) end print("Heli Spawned") end [/lua] Is there some type of keyvalue that I need to set for it to attack the player?
Try to use one of the inputs listed in [url]http://developer.valvesoftware.com/wiki/Npc_helicopter[/url] and it is unessesary for you to use player.GetByID when you already are looping a table of players, simply replace get by id with v
Do you know how to directly set the inputs via lua?
[b][url=http://wiki.garrysmod.com/?title=Entity.Fire]Entity.Fire [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
Gracias.
Sorry, you need to Log In to post a reply to this thread.