i want check ramp Paste on sleepingbag
(sorry I'm not good at English, I'm sorry if you don't understand)
Last edited:
Seems like there is an error loading the module It self. Can you copy paste the full code somehow?![]()
i want check ramp Paste on sleepingbag
(sorry I'm not good at English, I'm sorry if you don't understand)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fougerite;
using UnityEngine;
using System.IO;
using System.Net;
using System.Reflection;
namespace RampLoot
{
public class RampLoot : Fougerite.Module
{
private bool RampLoot_Enabled = true;
#region Plugin Des
public override string Name
{
get
{
return "RampLoot";
}
}
public override string Author
{
get
{
return "Developed By.SoGood";
}
}
public override string Description
{
get
{
return "RampLoot";
}
}
public override Version Version
{
get
{
return new Version("0.1");
}
}
#endregion
public override void Initialize()
{
Hooks.OnEntityDeployed += HandleEntityDeployed;
}
public override void DeInitialize()
{
Hooks.OnEntityDeployed -= HandleEntityDeployed;
}
public void HandleEntityDeployed(Fougerite.Player player, Fougerite.Entity en)
{
if (RampLoot_Enabled)
{
if (en != null)
{
if (en.Name.Contains("Ramp"))
{
player.Message(en.Name);
var location = en.Location;
float d = 3.5f;
var x = Physics.OverlapSphere(location, d);
if (x.Any(l => l.name.ToLower().Contains("SleepingBag")))
{
en.Destroy();
player.Message("ERROR");
}
}
}
}
}
}
}
When you created a class, did u name it RampLoot.cs?C#:using System; using System.Collections.Generic; using System.Linq; using System.Text; using Fougerite; using UnityEngine; using System.IO; using System.Net; using System.Reflection; namespace RampLoot { public class RampLoot : Fougerite.Module { private bool RampLoot_Enabled = true; #region Plugin Des public override string Name { get { return "RampLoot"; } } public override string Author { get { return "Developed By.SoGood"; } } public override string Description { get { return "RampLoot"; } } public override Version Version { get { return new Version("0.1"); } } #endregion public override void Initialize() { Hooks.OnEntityDeployed += HandleEntityDeployed; } public override void DeInitialize() { Hooks.OnEntityDeployed -= HandleEntityDeployed; } public void HandleEntityDeployed(Fougerite.Player player, Fougerite.Entity en) { if (RampLoot_Enabled) { if (en != null) { if (en.Name.Contains("Ramp")) { player.Message(en.Name); var location = en.Location; float d = 3.5f; var x = Physics.OverlapSphere(location, d); if (x.Any(l => l.name.ToLower().Contains("SleepingBag"))) { en.Destroy(); player.Message("ERROR"); } } } } } } }
public void HandleEntityDeployed(Fougerite.Player player, Fougerite.Entity en)
{
if (RampLoot_Enabled)
{
if (en != null)
{
if (en.Name.Contains("Ramp"))
{
player.Message(en.Name);
var location = en.Location;
float d = 3.5f;
var x = Physics.OverlapSphere(location, d);
//if (x.Any(l => l.name.ToLower().Contains("SleepingBag")))
//{
// en.Destroy();
// player.Message("ERROR");
//}
}
}
}
}
I assume that It's my code, cuz the vars and stuffs look like the same mechanism like in GlitchFix.if remove code
will not error
![]()
C#:public void HandleEntityDeployed(Fougerite.Player player, Fougerite.Entity en) { if (RampLoot_Enabled) { if (en != null) { if (en.Name.Contains("Ramp")) { player.Message(en.Name); var location = en.Location; float d = 3.5f; var x = Physics.OverlapSphere(location, d); //if (x.Any(l => l.name.ToLower().Contains("SleepingBag"))) //{ // en.Destroy(); // player.Message("ERROR"); //} } } } }
namespace RampLoot
{
using System;
using Fougerite;
using UnityEngine;
public class RampLoot : Fougerite.Module
{
private bool RampLoot_Enabled = true;
#region Plugin Des
public override string Name
{
get
{
return "RampLoot";
}
}
public override string Author
{
get
{
return "Developed By.SoGood";
}
}
public override string Description
{
get
{
return "RampLoot";
}
}
public override Version Version
{
get
{
return new Version("0.1");
}
}
#endregion
public override void Initialize()
{
Hooks.OnEntityDeployed += HandleEntityDeployed;
}
public override void DeInitialize()
{
Hooks.OnEntityDeployed -= HandleEntityDeployed;
}
public void HandleEntityDeployed(Fougerite.Player player, Fougerite.Entity en)
{
if (RampLoot_Enabled)
{
if (en != null)
{
if (en.Name.Contains("Ramp"))
{
player.Message(en.Name);
var location = en.Location;
float d = 3.5f;
var x = Physics.OverlapSphere(location, d);
foreach (var l in x)
{
if (l.name.ToLower().Contains("sleepingbag"))
{
en.Destroy();
player.Message("ERROR");
break;
}
}
}
}
}
}
}
Are u developing on 3.5?i try use source code GlitchFix Work
not error
Thanks
Paste me ur output logEntity Destroy ( en.Destroy(); )
what error ?
![]()
NullReferenceException: Object reference not set to an instance of an object
at Facepunch.MeshBatch.Runtime.MeshBatchPhysicalOutput.ActivateImmediatelyUnchecked () [0x00000] in <filename unknown>:0
at Facepunch.MeshBatch.Runtime.MeshBatchPhysicalOutput.OnQueue () [0x00000] in <filename unknown>:0
at Facepunch.MeshBatch.Runtime.Sealed.MeshBatchPhysicalIntegration.IntegrateOne () [0x00000] in <filename unknown>:0
at Facepunch.MeshBatch.Runtime.Sealed.MeshBatchPhysicalIntegration.FixedUpdate () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
NullReferenceException: Object reference not set to an instance of an object
at Facepunch.MeshBatch.Runtime.MeshBatchPhysicalOutput.ActivateImmediatelyUnchecked () [0x00000] in <filename unknown>:0
at Facepunch.MeshBatch.Runtime.MeshBatchPhysicalOutput.OnQueue () [0x00000] in <filename unknown>:0
at Facepunch.MeshBatch.Runtime.Sealed.MeshBatchPhysicalIntegration.IntegrateOne () [0x00000] in <filename unknown>:0
at Facepunch.MeshBatch.Runtime.Sealed.MeshBatchPhysicalIntegration.FixedUpdate () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
Check the latest update.Same here for nullreferenceException on Entity.Destory(), Doesn't effect anything it just throws an ugly red error in console, Destory works fine
Ok ThanksSame here for nullreferenceException on Entity.Destory(), Doesn't effect anything it just throws an ugly red error in console, Destory works fine
i try use Fougerite 1.2.8 not errorEntity Destroy ( en.Destroy(); )
what error ?
![]()