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
Share
Go down
avatar
Moderator
Moderator
Posts : 76
Points : 1926
Rep : 16
Join date : 2014-06-02
Age : 15
Location : Milky Way
View user profile

Slender Like Flashlight Script (Advanced == true);

on Fri Sep 05, 2014 5:28 pm
Message reputation : 100% (1 vote)
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;
}
}
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 1410
Rep : 0
Join date : 2014-09-10
View user profile

Re: Slender Like Flashlight Script (Advanced == true);

on Wed Sep 10, 2014 8:43 pm
Hi im wooden_sword789 but with my 2nd account
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 16
Points : 1518
Rep : 4
Join date : 2014-07-11
Age : 19
Location : usa
View user profilehttp://truefpscombat.wix.com/fpsassalt

Re: Slender Like Flashlight Script (Advanced == true);

on Tue Sep 30, 2014 3:54 pm
Nice
avatar
Moderator
Moderator
Posts : 76
Points : 1926
Rep : 16
Join date : 2014-06-02
Age : 15
Location : Milky Way
View user profile

Re: Slender Like Flashlight Script (Advanced == true);

on Tue Sep 30, 2014 5:04 pm
Thx
Back to top
Permissions in this forum:
You cannot reply to topics in this forum