When the player presses the button, he get PlayerModifier properties.

I will be grateful for the help :^)
Code: Select all
public string ModifierCustomID = "YourModifierCustomID";
public void GiveMods(TriggerArgs args){
if(args.Sender is IPlayer){
IPlayer ply = args.Sender as IPlayer;
IObjectPlayerModifierInfo mods = (IObjectPlayerModifierInfo)Game.GetSingleObjectByCustomID(ModifierCustomID);
ply.SetModifiers(mods.GetModifiers());
}
}
Thanks for your helpebomb09 wrote: ↑Wed Mar 20, 2019 8:08 pmYou will need to set the button's script method to 'GiveMods' and set the string in the script 'ModifierCustomID' to your PlayerModifierInfo CustomID.
Code: Select all
public string ModifierCustomID = "YourModifierCustomID"; public void GiveMods(TriggerArgs args){ if(args.Sender is IPlayer){ IPlayer ply = args.Sender as IPlayer; IObjectPlayerModifierInfo mods = (IObjectPlayerModifierInfo)Game.GetSingleObjectByCustomID(ModifierCustomID); ply.SetModifiers(mods.GetModifiers()); } }