Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit a7f42ed

Browse files
authored
Update admin.lua
1 parent 77b27c9 commit a7f42ed

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

admin.lua

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ local plugins_directory = "situation_plugins"
2424

2525
rconsolename("Welcome to Situation Admin | " .. User)
2626

27+
-- Some nonce wanted this
28+
local function split(str, sep)
29+
if #sep > 1 then
30+
return {}
31+
end
32+
33+
local tokens = {}
34+
35+
for v in str:gmatch("([^" .. sep .. "]+)") do
36+
table.insert(tokens, v)
37+
end
38+
39+
return tokens
40+
end
41+
2742
local function getroot(char)
2843
return char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
2944
end
@@ -363,11 +378,7 @@ while task.wait() do
363378
rconsoleprint("Input: ")
364379

365380
local args = rconsoleinput()
366-
local tokens = {}
367-
368-
for v in string.gmatch(args, "([^ ]+)") do
369-
table.insert(tokens, v)
370-
end
381+
local tokens = split(args, " ")
371382

372383
if tokens[1] ~= nil then
373384
load_plugins()

0 commit comments

Comments
 (0)