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 » wooden_sword's Advanced Flashlight Script Is Now Here

wooden_sword's Advanced Flashlight Script Is Now Here

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;
}
}
//Made by wooden_sword789! please dont give credit to yourself..

View user profile

DeveloperLuke


Moderator
Moderator
bounce bounce bounce bounce bounce bounce bounce bounce bounce bounce  yay finally i finished it!

View user profile
Nice! Thanks for sharing!

View user profile http://www.youtube.com/user/misterninjaboy

DeveloperLuke


Moderator
Moderator
Thank You

View user profile

DeveloperLuke


Moderator
Moderator
I am going to make a Health script next

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