Jump to content

Kainnax

Members
  • Posts

    1
  • Joined

  • Last visited

Nexus Mods Profile

About Kainnax

Kainnax's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Can anyone help me please? I'm trying to make a simple hl_like_flashlight mod, but it doesn't work at all. ChatGPT didn't help, although it tried really hard. DLL compiles smoothly, mod loader sees the mod, but that is all where I've got so far. Halp. using MSCLoader; using UnityEngine; namespace Flashlight { public class Flashlight : Mod { public override string ID => "Flashlight"; public override string Name => "Flashlight"; public override string Author => "Pisosss"; public override string Version => "1.2.666"; public override string Description => ""; private KeyCode LampKey = KeyCode.X; private bool LampOff; private Light flashlight; public override void OnLoad() { LampOff = true; GameObject player = GameObject.Find("PLAYER"); flashlight = player.AddComponent<Light>(); flashlight.type = LightType.Spot; flashlight.color = Color.white; flashlight.spotAngle = 70; flashlight.intensity = 4; flashlight.range = 20; flashlight.enabled = false; } public override void Update() { if (Input.GetKey(LampKey)) { LampOff = !LampOff; flashlight.enabled = !LampOff; } } } }
×
×
  • Create New...