1. Oxide for Rust Legacy has been discontinued and is no longer supported. No updates or additions will be made, and Rust Legacy-specific plugin submissions will no longer be accepted. We recommend upgrading to the latest version of Rust as able.
    Dismiss Notice
  1. mcnovinho08

    mcnovinho08 Scavenger Plugin Developer

    Hi, I'm trying to make an edit in the vegod plugin, I wanted to add some time to this void.

    String userid = netuser.playerClient.userID.ToString ();

    If (! Gods.Contains (userid))
    {
    Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (true);
    Gods.Add (userid);

    }
    Else if (Gods.Contains (userid))
    {
    Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (false);
    Gods.Remove (userid);

    }
    }

    So that when the player executes the command he gains a little immortal time.
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    When exactly are you wanting him to be immortal?
     
  3. P0LENT4

    P0LENT4 Wood Hoarder Plugin Developer

    So I realize you have a list of type string

    Use / god [time]

    Code (Text):

    [ChatCommand("god")]
    void cmdGod(NetUser netuser, string command, string[] args)
    {
        string userid = netuser.playerClient.userID.ToString();
        int timer = Convert.ToInt32(args[0]);
        if (!Gods.Contains(userid))
        {
            Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (true);
            Gods.Add(userid);
            rust.Notice(netuser, string.Format("You have earned {0} seconds of GodMode"), timer);
            timer.Once(timer, ()=>
            {
                Gods.Remove(userid);
                rust.Notice(netuser, ("Your time is up, GodMode removed");
            });
        }
        else if (Gods.Contains(userid))
        {
            Netuser.playerClient.rootControllable.rootCharacter.takeDamage.SetGodMode (false);
            Gods.Remove(userid);
            rust.Notice(netuser, ("You were already in godmode and it was removed.");
            return;

        }

    }
    I hope I have helped :)