Skip to content

Commit

Permalink
Merge pull request #515 from fxeP1/master
Browse files Browse the repository at this point in the history
TrelloBan fix, Commands/PlayerFinders/Track Command changes.
  • Loading branch information
Sceleratis authored Oct 8, 2021
2 parents b77bb3a + e39204a commit b78602b
Show file tree
Hide file tree
Showing 17 changed files with 760 additions and 624 deletions.
236 changes: 128 additions & 108 deletions MainModule/Client/Core/Functions.lua

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions MainModule/Client/UI/Default/List.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ return function(data)

function doSearch(tab, text)
local found = {}
text = tostring(text):lower()
for i,v in next,tab do
if text == "" or (type(v) == "string" and v:lower():find(text)) or (type(v) == "table" and ((v.Text and tostring(v.Text):lower():find(text)) or (v.Filter and v.Filter:lower():find(text)))) then
text = string.lower(tostring(text))
for i,v in pairs(tab) do
if text == "" or (type(v) == "string" and string.find(string.lower(v),text)) or (type(v) == "table" and ((v.Text and string.find(string.lower(tostring(v.Text)), text)) or (v.Filter and string.find(string.lower(v.Filter),text)))) then
table.insert(found, v)
end
end
Expand Down Expand Up @@ -160,7 +160,7 @@ return function(data)
pageCounterLabel.Visible = false;
end

for i,v in next,scroller:GetChildren() do
for i,v in ipairs(scroller:GetChildren()) do
v:Destroy()
end

Expand Down
18 changes: 10 additions & 8 deletions MainModule/Server/Commands/Admins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1289,27 +1289,29 @@ return function(Vargs, env)
local appkey = Settings.Trello_AppKey
local token = Settings.Trello_Token

if not Settings.Trello_Enabled or board == "" or appkey == "" or token == "" then server.Functions.Hint('Trello has not been configured in settings', {plr}) return end
if not Settings.Trello_Enabled or board == "" or appkey == "" or token == "" then Functions.Hint('Trello has not been configured in settings', {plr}) return end

local trello = HTTP.Trello.API(appkey,token)
local lists = trello.getLists(board)
local list = trello.getListObj(lists,{"Banlist","Ban List","Bans"})

local level = data.PlayerData.Level
for i,v in pairs(service.GetPlayers(plr,args[1], {
for _, v in pairs(service.GetPlayers(plr,args[1], {
DontError = false;
IsServer = false;
IsKicking = true;
UseFakePlayer = true;
}))do
})) do
if level > Admin.GetLevel(v) then
trello.makeCard(list.id,tostring(v)..":".. tostring(v.UserId),
"Administrator: " .. tostring(plr) ..
"\nReason: ".. (args[2] or "N/A"))
HTTP.Trello.Update()
Functions.Hint("Trello banned ".. tostring(v),{plr})
trello.makeCard(list.id,
string.format("%s:%d", (v and tostring(v.Name) or tostring(v)), tostring(v.UserId)),
string.format("Administrator: %s\nReason: %s", plr.Name, (args[2] or "N/A"))
)
Functions.Hint("Trello banned ".. (v and tostring(v.Name) or tostring(v)), {plr})
end
end

HTTP.Trello.Update()
end;
};

Expand Down
37 changes: 19 additions & 18 deletions MainModule/Server/Commands/Fun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ return function(Vargs, env)
audio.Volume = 0.5
audio:Play()
wait(2)
for i,part in next,Variables.FrozenObjects do
for i,part in pairs(Variables.FrozenObjects) do
part.Anchored = false
end

Expand Down Expand Up @@ -491,7 +491,7 @@ return function(Vargs, env)
if not speed or not tonumber(speed) then
speed = 1000
end
for i,v in next,service.GetPlayers(plr,args[1]) do
for i,v in pairs(service.GetPlayers(plr,args[1])) do
Remote.Send(v,"Function","Dizzy",tonumber(speed))
end
end
Expand Down Expand Up @@ -983,7 +983,7 @@ return function(Vargs, env)
end
end

for i,p in next,players do
for i,p in pairs(players) do
service.TrackTask("Thread: Thanos", function()
for t = 0.1,1.1,0.05 do
if p.Character then
Expand Down Expand Up @@ -1110,7 +1110,7 @@ return function(Vargs, env)
error(forYou[ind])
end

for i,p in next,service.GetPlayers(plr,args[1]) do
for i,p in ipairs(service.GetPlayers(plr,args[1])) do
service.TrackTask("Thread: UFO", function()
local char = p.Character
local torso = p.Character:FindFirstChild("HumanoidRootPart")
Expand Down Expand Up @@ -1184,7 +1184,7 @@ return function(Vargs, env)
torso.Anchored = true
tween:Play()

for i,v in next,p.Character:GetChildren() do
for i,v in ipairs(p.Character:GetChildren()) do
if v:IsA("BasePart") then
service.TweenService:Create(v, TweenInfo.new(1), {
Transparency = 1
Expand Down Expand Up @@ -1216,7 +1216,7 @@ return function(Vargs, env)
end
]])

for i,v in next,p.Character:GetChildren() do
for i,v in ipairs(p.Character:GetChildren()) do
if v:IsA("BasePart") then
v.Anchored = true
v.Transparency = 1
Expand Down Expand Up @@ -1402,7 +1402,7 @@ return function(Vargs, env)
error(forYou[ind])
end

for i,p in next,service.GetPlayers(plr,args[1]) do
for i,p in ipairs(service.GetPlayers(plr,args[1])) do
spawn(function()
local char = p.Character
local torso = p.Character:FindFirstChild("HumanoidRootPart")
Expand Down Expand Up @@ -1674,7 +1674,7 @@ return function(Vargs, env)
local nukes = {}
local partsHit = {}

for i,v in next,Functions.GetPlayers(plr, args[1]) do
for i,v in ipairs(Functions.GetPlayers(plr, args[1])) do
local char = v.Character
local human = char and char:FindFirstChild("HumanoidRootPart")
if human then
Expand Down Expand Up @@ -1714,15 +1714,15 @@ return function(Vargs, env)
end

for i = 1, 333 do
for i,v in next,nukes do
for i,v in pairs(nukes) do
local curPos = v.CFrame
v.Size = v.Size + Vector3.new(3, 3, 3)
v.CFrame = curPos
end
wait(1/44)
end

for i,v in next,nukes do
for i,v in pairs(nukes) do
v:Destroy()
end

Expand Down Expand Up @@ -1763,7 +1763,7 @@ return function(Vargs, env)
partsHit = nil
finished = true
elseif partsHit and objs and Variables.WildFire ~= partsHit then
for i,v in next,objs do
for i,v in pairs(objs) do
v:Destroy()
end

Expand Down Expand Up @@ -1813,7 +1813,7 @@ return function(Vargs, env)
end
end

for i,v in next,Functions.GetPlayers(plr, args[1]) do
for i,v in pairs(Functions.GetPlayers(plr, args[1])) do
local char = v.Character
local human = char and char:FindFirstChild("HumanoidRootPart")
if human then
Expand Down Expand Up @@ -2703,7 +2703,7 @@ return function(Vargs, env)

torso.Transparency = 1

for i,v in next,torso:GetChildren() do
for i,v in ipairs(torso:GetChildren()) do
if v:IsA'Motor6D' then
local lc0 = service.New('CFrameValue', {Name='LastC0';Value=v.C0;Parent=v})
end
Expand Down Expand Up @@ -4813,11 +4813,12 @@ return function(Vargs, env)
Function = function(plr,args)
for _, v in ipairs(service.GetPlayers(plr, args[1])) do
if v.Character and v.Character.PrimaryPart then
local Explosion = service.New("Explosion")
Explosion.Position = v.Character.PrimaryPart.Position
Explosion.BlastRadius = args[2] or 20
Explosion.Archivable = false
Explosion.Parent = workspace.Terrain
service.New("Explosion", {
Position = v.Character.PrimaryPart.Position,
BlastRadius = args[2] or 20,
Archivable = false,
Parent = workspace.Terrain
})
end
end
end
Expand Down
30 changes: 14 additions & 16 deletions MainModule/Server/Commands/HeadAdmins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,24 @@ return function(Vargs, env)
Commands = {"tempban";"timedban";"timeban";"tban";"temporaryban"};
Args = {"player";"number<s/m/h/d>";"reason"};
Hidden = false;
Filter = true;
Description = "Bans the target player(s) for the supplied amount of time; Data Persistent; Undone using :untimeban";
Fun = false;
AdminLevel = "HeadAdmins";
Function = function(plr,args,data)
assert(args[1] and args[2], "Argument missing or nil")
local time = args[2]

if time:lower():sub(#time)=='s' then
time = time:sub(1,#time-1)
local lower, sub = string.lower, string.sub
if sub(lower(time), #time)=='s' then
time = sub(time, 1, #time-1)
time = tonumber(time)
elseif time:lower():sub(#time)=='m' then
time = time:sub(1,#time-1)
elseif sub(lower(time), #time)=='m' then
time = sub(time, 1, #time-1)
time = tonumber(time)*60
elseif time:lower():sub(#time)=='h' then
time = time:sub(1,#time-1)
time = (tonumber(time)*60)*60
elseif time:lower():sub(#time)=='d' then
time = time:sub(1,#time-1)
elseif sub(lower(time), #time)=='h' then
time = sub(time, 1, #time-1)
time = ((time)*60)*60
elseif sub(lower(time), #time)=='d' then
time = sub(time, 1, #time-1)
time = ((tonumber(time)*60)*60)*24
end

Expand All @@ -49,7 +48,7 @@ return function(Vargs, env)
}) do
if level > Admin.GetLevel(v) then
local endTime = os.time() + tonumber(time)
local reason = args[3] or "No reason provided";
local reason = service.Filter(args[3], plr, v) or "No reason provided";
local data = {
Name = v.Name;
UserId = v.UserId;
Expand All @@ -69,7 +68,7 @@ return function(Vargs, env)
Value = data;
})

Functions.Hint("Banned "..tostring(v.Name).." for "..tostring(time),{plr})
Functions.Hint("Banned "..tostring(v.Name).." for ".. tostring(time),{plr})
end
end
end
Expand Down Expand Up @@ -330,11 +329,10 @@ return function(Vargs, env)
AdminLevel = "HeadAdmins";
Function = function(plr,args)
local objects = service.GetAdonisObjects()

for i,v in next,objects do
for i,v in pairs(objects) do
v:Destroy()
table.remove(objects, i)
end
table.clear(objects)

--for i,v in next,Functions.GetPlayers() do
-- Remote.Send(v, "Function", "ClearAllInstances")
Expand Down
Loading

0 comments on commit b78602b

Please sign in to comment.