Files
IL-GSC/BO1/PC/ZM/clientscripts/_destructibles.csc
2024-02-18 17:32:07 -05:00

38 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include clientscripts\_utility;
#include clientscripts\_lights;
destructible_thread(client_num)
{
owner = getlocalplayers()[client_num];
if(isdefined(owner))
{
if(!isdefined(self.script_light_label))
{
return;
}
self.lights = get_lights_by_label(self.script_light_label);
if(self.lights.size == 0)
{
println("*** Client : Destructable " + self.destructibledef + " at " + self.origin + " cannot find any lights labelled + " + self.script_light_label);
return;
}
level._num_lit_destructibles ++;
owner endon("disconnect");
println("Waiting for broken");
self waittill( "broken", broken_notify );
println("Got broken.");
switch_light_mixers(self.lights);
println("Switched.");
return;
}
}
init(client_num)
{
if(IsSplitScreenHost(client_num))
{
level._num_lit_destructibles = 0;
array_thread( getentarray( client_num, "destructible", "targetname" ), ::destructible_thread, client_num );
waittillframeend;
println("*** Client : Lit destructibles " + level._num_lit_destructibles);
}
}