How do I Set: RunSpeed, JumpHeight, fireRate, tons more...

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
86
18
California
So, I'm going to assume that I will have to compile a custom Fougerite Core for this to work but I'll ask anyways

Im looking for a way to set run speed:
C#:
using UnityEngine;

public class CharacterWalkSpeedTrait : CharacterTrait
{
  [SerializeField]
  private float _jog = 3f;
  [SerializeField]
  private float _run = 6f;
  [SerializeField]
  private float _walk = 1.8f;

  public float jog
  {
    get
    {
      return this._jog;
    }
  }

  public float run
  {
    get
    {
      return this._run;
    }
  }

  public float walk
  {
    get
    {
      return this._walk;
    }
  }

  public bool IsRunningAtSpeed(float metersPerSecond)
  {
    if ((double) this._jog < (double) this._run)
      return (double) this._run <= (double) metersPerSecond;
    else
      return (double) this._run > (double) metersPerSecond;
  }

  public bool IsJoggingOrRunningAtSpeed(float metersPerSecond)
  {
    if ((double) this._jog < (double) this._run)
      return (double) this._jog <= (double) metersPerSecond;
    else
      return (double) this._run <= (double) metersPerSecond;
  }
}
Since
[SerializeField]
private float _jog = 3f;
[SerializeField]
private float _run = 6f;
[SerializeField]
private float _walk = 1.8f;
are private, assuming will have to set as plugin with custom Fougerite core?

I figured out how to set refill ammoclip however it glitches if you switch to a non weapon and breaks ALL plugins, my code:
JavaScript:
function On_PluginInit(){
    Plugin.CreateTimer("Timer", 5).Start();
}
function TimerCallback(){
    for(var player in Server.Players){
        if(player != null && player.Name){
            player.Inventory.InternalInventory.activeItem.SetUses(99);
        }
    }
    Plugin.CreateTimer("Timer", 5).Start();
}
function On_Command(Player, cmd, args) {
    if(cmd == "ammo") {
        var ammoamount = 99;
        Player.Inventory.InternalInventory.activeItem.SetUses(ammoamount);
        Player.Message("Ammo Updated to:" + ammoamount);
    }
}
Easiest way to fix this and have it set refill ammo either perm or on a timer?

Also any way to set core settings? Gravity? acceleration speeds of player/objects? Jumpspeed/height, reloadspeed? Firerate? Healrate? How about how to inflict dmg to a player? setMaxHealth? Nobleeding?
 
Last edited:

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
You can also get the activeItem name, and if it's a gun then set the uses to whatever.
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
86
18
California
You can also get the activeItem name, and if it's a gun then set the uses to whatever.
I have updated my code to reflect this, now checks for specific weapon names :)
Testing last test right now, if all works Unlimited Clip Ammo Plugin is done.
 
  • Like
Reactions: Snake