Jump to content

they can't be killed

Pending 1.3.1

Watcher
Watcher

Posted

NPC's on the snowscooters can't be killed and don't move 🙂

20260705154858_1.jpg

  • Like 1
aimacak

Posted (edited)

@Watcher
Hello again 🙂 Check it out after the fixes from the FerryTerminalEvent's ticket, if the situation persists, please send your config, I will try to repeat it.

Edited by aimacak
aimacak

Posted

Does this happen every time the event launches?

Watcher

Posted

will start one and let you know

 

  • Like 1
aimacak

Posted (edited)

Thanks, yeah, i found it.
Replace please this method in *.cs
this is a good fix, at least until the fix from KpucTaJI.
The thing was, when security killed Scientist, a wave of new security appeared, and it became attached to Scientist, but it no longer exists. In this fix, if the Scientsit no longer exist, they will be attached to the Pilot.

            private IEnumerator DestroySnowmobile(SnowmobileData data)
            {
                yield return CoroutineEx.waitForSeconds(1f);

                if (data.Driver.IsExists())
                {
                    data.Driver.EnsureDismounted();
                    data.Driver.Kill();
                }
                ScientistNPC driver = SpawnSnowmobileNpc(data.Snowmobile.transform.position, false, false);
                _ins.NpcSpawn.Call("SetParent", driver, Scientist.IsExists() ? Scientist.transform : Pilot.transform, Vector3.zero, 1f);
                Scientists.Add(driver);

                if (data.Passenger.IsExists())
                {
                    data.Passenger.EnsureDismounted();
                    data.Passenger.Kill();
                }
                ScientistNPC passenger = SpawnSnowmobileNpc(data.Snowmobile.transform.position, false, false);
                _ins.NpcSpawn.Call("SetParent", passenger, Scientist.IsExists() ? Scientist.transform : Pilot.transform, Vector3.zero, 1f);
                Scientists.Add(passenger);

                if (_ins.ActivePveMode) _ins.PveMode.Call("EventAddScientists", _ins.Name, new HashSet<ulong> { driver.net.ID.Value, passenger.net.ID.Value });

                yield return CoroutineEx.waitForSeconds(1f);

                if (data.Snowmobile.IsExists())
                {
                    EntityFuelSystem fuelSystem = data.Snowmobile.GetFuelSystem() as EntityFuelSystem;
                    fuelSystem.GetFuelContainer().inventory.ClearItemsContainer();
                    data.Snowmobile.Kill();
                }

                Snowmobiles.Remove(data);
            }

 

Edited by aimacak

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.7m
Total downloads
Customers
11.5k
Customers served
Files Sold
165k
Total sales
Payments
3.6m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.