-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
54 lines (47 loc) · 1.61 KB
/
Plugin.cs
File metadata and controls
54 lines (47 loc) · 1.61 KB
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
46
47
48
49
50
51
52
53
54
using LabApi.Features;
using LabApi.Features.Console;
using LabApi.Features.Wrappers;
using LabApi.Loader.Features.Configuration;
using LabApi.Loader.Features.Plugins;
using LabApi.Events.Arguments.PlayerEvents;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LabApi.Events.Handlers;
namespace PinkCandy_LabAPI
{
public class Plugin : Plugin<Config>
{
public override string Name => "PinkCandy";
public override string Description => "get pink candy";
public override string Author => "九尾狐0513";
public override Version Version => new Version(1,0,1);
public override Version RequiredApiVersion => new Version(LabApiProperties.CompiledVersion);
public override void Disable()
{
if (!base.Config.IsEnabled)
{
Logger.Info("The plugin has been disabled");
return;
}
PlayerEvents.InteractingScp330 += OnPlayerInteractingScp330;
}
public override void Enable()
{
PlayerEvents.InteractingScp330 += OnPlayerInteractingScp330;
Logger.Info("The plugin has been disabled");
}
public static void OnPlayerInteractingScp330(PlayerInteractingScp330EventArgs ev)
{
int Probably = Config.probably;
int random = new Random().Next(1, Probably + 1);
bool can = random == 1;
if (can)
{
ev.CandyType = InventorySystem.Items.Usables.Scp330.CandyKindID.Pink;
}
}
}
}