Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » FREE Project Downloads & Recources » Scripts » Slender Like Flashlight Script (Advanced == true);

Slender Like Flashlight Script (Advanced == true);

View previous topic View next topic Go down  Message [Page 1 of 1]

DeveloperLuke


Moderator
Moderator
var lightbulb : Light;
var batterylevel : float = 5000.0;
var batterylower1 : float = 0.1;
var putasbatterylower1 = 0.1;
var onoffsound : AudioClip;


function Update () {
if(!lightbulb.enabled) {
batterylower1 = 0;
}
if(Input.GetButtonDown("Fire1")){
lightbulb.enabled = !lightbulb.enabled;
batterylower1 = putasbatterylower1;
audio.PlayOneShot(onoffsound);
}
batterylevel = batterylevel - batterylower1;
if(batterylevel <- 1) {
lightbulb.enabled = false;
}
}

View user profile

wooden_sword790


Member [Lv. 0]
Member [Lv. 0]
Hi im wooden_sword789 but with my 2nd account

View user profile

FPS assault


Member [Lv. 3]
Member [Lv. 3]
Nice

View user profile http://truefpscombat.wix.com/fpsassalt

DeveloperLuke


Moderator
Moderator
Thx

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum