FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionwooden_sword's Advanced Flashlight Script Is Now Here

more_horiz
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..

descriptionRe: wooden_sword's Advanced Flashlight Script Is Now Here

more_horiz
bounce bounce bounce bounce bounce bounce bounce bounce bounce bounce  yay finally i finished it!

descriptionRe: wooden_sword's Advanced Flashlight Script Is Now Here

more_horiz
Nice! Thanks for sharing!

descriptionRe: wooden_sword's Advanced Flashlight Script Is Now Here

more_horiz
Thank You

descriptionRe: wooden_sword's Advanced Flashlight Script Is Now Here

more_horiz
I am going to make a Health script next
Permissions in this forum:
You cannot reply to topics in this forum