How to call an heli using LUA?
Thanks
Calling an heli?
Discussion in 'Rust Development' started by Rusty, Sep 28, 2015.
-
Wulf Community Admin
rust.RunServerCommand + Spawning / calling chopper? | Oxide
-
Code:
rust.RunServerCommand("heli.call")
[DOUBLEPOST=1443481373][/DOUBLEPOST]there is a global.RunConsoleCommand but it gives me a not a table error when i call it.
global.RunConsoleCommand("heli.call")
attempt to index runcosolecommand a table valueLast edited by a moderator: Sep 29, 2015 -
Wulf Community Admin
The rust.RunServerCommand is provided by Oxide, not Rust. You won't see anything returned when calling heli.call as far as I know. -
Then how do you do it ive been playing all day, i think this is the way to go
Code:local entity = global.GameManager.server.CreateEntity.methodarray[0]:Invoke(nil,util.TableToArray({ "events/cargo_plane", new( UnityEngine.Vector3._type, nil ), new( UnityEngine.Quaternion._type, nil ) }))
-
Wulf Community Admin
-
Yea i know if i can call the cargo i can call the heli, lua trully sucks but .cs is confusing for me..let me know if u can come up with something.
[DOUBLEPOST=1443493065,1443482745][/DOUBLEPOST]Wulf: hook a brother up. -
Wulf Community Admin
-
I don't not anything about LUA, but here's my C# code to spawn a helo, and have it first "visit" somebody (or at least, where they were). It's simple enough, I'm sure you can figure out the LUA;
(This code is essentially just a cut and paste from the "heli.calltome" console command)
Code:BasePlayer target = outlaws.SingleOrDefault(p => p.displayName.StartsWith(targetPartialName)); BaseEntity entity = GameManager.server.CreateEntity("assets/bundled/prefabs/npc/patrol_helicopter/PatrolHelicopter.prefab", new Vector3(), new Quaternion(), true); if (entity != null) { entity.GetComponent<PatrolHelicopterAI>().SetInitialDestination(target.transform.position + new Vector3(0.0f, 10f, 0.0f), 0.25f); entity.Spawn(true); }