Hello there i am Making a script, atm that will pup lights on the Dome and Rad town etc
and other, places on the map,
ive a Question How can i set health of the Lanten/ceiling Light to example? 1000 health
Making the dome popup with light?
Discussion in 'Rust Development' started by Brobagh, Jun 30, 2016.
-
Attached Files:
-
-
You need to access _health and _maxHealth of the BaseCombatEntity by a Fieldinfo:
this can be used then with "Setvalue", example:Code:private FieldInfo _lightHealth = typeof(BaseCombatEntity).GetField("_health", (BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic)); private FieldInfo _lightMaxHealth = typeof(BaseCombatEntity).GetField("_maxHealth", (BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic));
is using a custom variable for the health:Code:_lightHealth.SetValue(lightentity, 1000f); _lightMaxHealth.SetValue(lightentity, 1000f);
Code:_lightHealth.SetValue(lightentity, Convert.ToSingle(inputvariable));
-
Yo t
Yo thanks for your reply Mate,




