A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Flashlight Time

Author Topic: Flashlight Time (3 messages, Page 1 of 1)
Moderators: Dennis

NEOLightJak
Joined: Jan 6, 2011


Posted: Jul 17, 2011 06:53 AM    Msg. 1 of 3       
Is there a script that can make the flashlight last a specific period of time?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Jul 17, 2011 11:59 AM    Msg. 2 of 3       
(global short limit 30)
(global short p0flashlight 0)
(script static "unit" player
(unit (list_get (players) 0))
)
(script continuous flashlightusage
(if (unit_get_current_flashlight_state (player)) (set p0flashlight (+ p0flashlight 1)) (if (> p0flashlight 0) (set p0flashlight (- p0flashlight 1))))
(if (>= p0flashlight limit) (unit_set_desired_flashlight_state (player) 0))
(sleep 30)
)

Set the variable limit at the top to what ever duration you require. It's currently only setup for player0 (newest joined player) but you get the idea from it if you need to set it up for MP.
If there flashlight is on, make the flashlight variable 1 higher than it currently is, if not, make it one lower as long as the flashlight variable isnt lower than 0. Then if the flashlight record is larger or equal to the limit, forcibly turn the flashlight off.


NEOLightJak
Joined: Jan 6, 2011


Posted: Jul 17, 2011 05:11 PM    Msg. 3 of 3       
Quote: --- Original message by: kirby_422
(global short limit 30)
(global short p0flashlight 0)
(script static "unit" player
(unit (list_get (players) 0))
)
(script continuous flashlightusage
(if (unit_get_current_flashlight_state (player)) (set p0flashlight (+ p0flashlight 1)) (if (> p0flashlight 0) (set p0flashlight (- p0flashlight 1))))
(if (>= p0flashlight limit) (unit_set_desired_flashlight_state (player) 0))
(sleep 30)
)

Set the variable limit at the top to what ever duration you require. It's currently only setup for player0 (newest joined player) but you get the idea from it if you need to set it up for MP.
If there flashlight is on, make the flashlight variable 1 higher than it currently is, if not, make it one lower as long as the flashlight variable isnt lower than 0. Then if the flashlight record is larger or equal to the limit, forcibly turn the flashlight off.


That was very useful, thank you.

 

 
Previous Older Thread    Next newer Thread







Time: Wed May 27, 2020 9:44 PM 156 ms.
A Halo Maps Website