-
Notifications
You must be signed in to change notification settings - Fork 4
/
Speed.cs
45 lines (34 loc) · 1.1 KB
/
Speed.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using BrokeProtocolClient.modules;
using BrokeProtocolClient.settings;
using BrokeProtocolClient.UI;
using BrokeProtocolClient.utils;
namespace BrokeProtocolClient.modules.movement
{
class Speed : Module
{
public NumberSetting speed = new NumberSetting("Speed", 0, 5, 2.5, 0.1);
float defaultMaxSpeed = 12f;
public Speed() : base(Categories.Movement, "Speed", "Allows to modify players speed")
{
addSetting(speed);
}
public override void onActivate()
{
}
public override void onDeactivate()
{
if (!getClient().ClManager.myPlayer) return;
getClient().ClManager.myPlayer.maxSpeed = defaultMaxSpeed;
}
public override void onRender()
{
}
public override void onUpdate()
{
if (!getClient().ClManager.myPlayer) return;
getClient().ClManager.myPlayer.maxSpeed = defaultMaxSpeed * speed.getValueFloat();
}
}
}