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 : 1954
Rep : 16
Join date : 2014-06-02
Age : 15
Location : Milky Way
View user profile

wooden_sword's Advanced Flashlight Script Is Now Here

on Thu Aug 14, 2014 5:21 pm
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..
avatar
Moderator
Moderator
Posts : 76
Points : 1954
Rep : 16
Join date : 2014-06-02
Age : 15
Location : Milky Way
View user profile

Re: wooden_sword's Advanced Flashlight Script Is Now Here

on Thu Aug 14, 2014 5:27 pm
bounce bounce bounce bounce bounce bounce bounce bounce bounce bounce  yay finally i finished it!
avatar
Admin
Admin
Posts : 608
Points : 3197
Rep : 406
Join date : 2013-12-11
Age : 21
View user profilehttps://www.youtube.com/user/misterninjaboy

Re: wooden_sword's Advanced Flashlight Script Is Now Here

on Sat Aug 16, 2014 1:48 am
Nice! Thanks for sharing!
avatar
Moderator
Moderator
Posts : 76
Points : 1954
Rep : 16
Join date : 2014-06-02
Age : 15
Location : Milky Way
View user profile

Re: wooden_sword's Advanced Flashlight Script Is Now Here

on Sat Aug 16, 2014 9:42 am
Thank You
avatar
Moderator
Moderator
Posts : 76
Points : 1954
Rep : 16
Join date : 2014-06-02
Age : 15
Location : Milky Way
View user profile

Re: wooden_sword's Advanced Flashlight Script Is Now Here

on Sat Aug 16, 2014 9:43 am
I am going to make a Health script next
Back to top
Permissions in this forum:
You cannot reply to topics in this forum