-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathttt_dev.lua
More file actions
84 lines (55 loc) · 1.48 KB
/
ttt_dev.lua
File metadata and controls
84 lines (55 loc) · 1.48 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
if SAM_LOADED then return end
local run = function(fn)
if not GAMEMODE then
timer.Simple(0, fn)
else
fn()
end
end
run(function()
if engine.ActiveGamemode() ~= "terrortown" then return end
sam.command.set_category("TTT Dev")
sam.command.new("bot")
:SetPermission("bot", "superadmin")
:Help("Spawn bot(s).\n(Number of bots to spawn.)")
:AddArg("number", {
optional = true,
default = 1,
hint = "number",
min = 0,
max = 128,
round = true,
})
:OnExecute(function(calling_ply, targets)
for i = 1, targets do
RunConsoleCommand("bot", "\n")
end
end)
:End()
sam.command.new("bot_mimic")
:SetPermission("bot_mimic", "superadmin")
:Help("bots will mimic player")
:OnExecute(function(calling_ply, targets)
RunConsoleCommand("bot_mimic", "1")
end)
:End()
sam.command.new("console")
:SetPermission("console", "superadmin")
:Help("Console command")
:AddArg("text")
:OnExecute(function(calling_ply, targets)
game.ConsoleCommand(targets .. "\n")
end)
:End()
sam.command.new("freezebots")
:SetPermission("freezebots", "superadmin")
:Help("Stop bots from moving")
:OnExecute(function(calling_ply)
for k, v in pairs(player.GetAll()) do
if v:IsBot() then
v:SetWalkSpeed(1)
end
end
end)
:End()
end)