Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :ckick command #1614

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions MainModule/Client/Core/Functions.luau
Original file line number Diff line number Diff line change
Expand Up @@ -1074,22 +1074,22 @@ return function(Vargs, GetEnv)
cam[prop] = value
end
end;

SetFPS = function(fps)
service.StopLoop("SetFPS")
local fps = tonumber(fps)

if fps then
service.StartLoop("SetFPS",0.1,function()
local osclock = os.clock()
repeat while osclock + 1/fps > os.clock() do end
repeat while osclock + 1/fps > os.clock() do end
task.wait()
osclock = os.clock()
osclock = os.clock()
until service.IsLooped("SetFPS") == false
end)
end
end;

RestoreFPS = function()
service.StopLoop("SetFPS")
end;
Expand Down Expand Up @@ -1206,6 +1206,23 @@ return function(Vargs, GetEnv)
end
end;

CustomKick = function()
service.TweenService:Create(service.New("BlurEffect", {
Parent = service.Lighting; Size = 10;
}), TweenInfo.new(0.5, Enum.EasingStyle.Sine), {Size = 30}):Play()

service.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

for _, v in service.PlayerGui:GetChildren() do
if v.Name ~= "RobloxPromptGui" then
pcall(v.Destroy, v)
end
end

task.wait(0.5)
Functions.HardCrash()
end;

KillClient = function()
client.Kill("KillClient called")
end;
Expand Down Expand Up @@ -1424,7 +1441,7 @@ return function(Vargs, GetEnv)
local ang = 0.1
local oldmag = torso.AssemblyLinearVelocity.Magnitude
local mv = .002
if wave then
if wave then
ang += ((torso.AssemblyLinearVelocity.Magnitude/10)*.05)+.05
wave = false
else
Expand Down
57 changes: 53 additions & 4 deletions MainModule/Server/Commands/Admins.luau
Original file line number Diff line number Diff line change
Expand Up @@ -963,13 +963,13 @@ return function(Vargs, env)
local new = Core.NewScript("LocalScript", `script.Parent = game:GetService('Players').LocalPlayer.PlayerScripts; {args[2]}`, true)
local function cloneScript(targetPlayer)
local playerName = if targetPlayer == plr then "your client" else service.FormatPlayer(targetPlayer)

local backpack = targetPlayer:FindFirstChildOfClass("Backpack")
if not backpack then
if not backpack then
Functions.Hint(`Couldn't run LocalScript on {playerName} (Backpack missing?)`, {plr})
return
end

local cl = new:Clone()
cl.Name = "[Adonis] LocalScript"
cl.Disabled = true
Expand All @@ -978,7 +978,7 @@ return function(Vargs, env)
cl.Disabled = false
Functions.Hint(`Ran LocalScript on {playerName}`, {plr})
end

for i, v in service.GetPlayers(plr, args[1]) do
task.spawn(cloneScript, v)
end
Expand Down Expand Up @@ -1262,6 +1262,55 @@ return function(Vargs, env)
end
};

CustomKick = {
Prefix = Settings.Prefix;
Commands = {"ckick", "customkick", "customcrash"};
Args = {"player", "title", "message"};
Description = "Disconnects (crashes) the target player with a custom Roblox dialog";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[3], "Argument(s) missing or nil")

local title = service.BroadcastFilter(args[2], plr)
assert(title == args[2], "Title was filtered: "..title)

local msg = service.BroadcastFilter(args[3], plr)
assert(msg == args[3], "Message was filtered: "..msg)

for _, v in service.GetPlayers(plr, args[1], {
IsKicking = true;
NoFakePlayer = false;
})
do
if not Admin.CheckAuthority(plr, v, "custom-kick") then
continue
end

local plrgui = v:FindFirstChildOfClass("PlayerGui")
if not plrgui then
Remote.MakeGui(plr, "Output", {
Message = `Failed to custom-kick {service.FormatPlayer(v)} (PlayerGui not found)`;
})
continue
end

local promptGui = Deps.Assets.RobloxPromptGui:Clone()
promptGui.promptOverlay.ErrorPrompt.TitleFrame.ErrorTitle.Text = title
promptGui.promptOverlay.ErrorPrompt.MessageArea.ErrorFrame.ErrorMessage.Text = msg
promptGui.Parent = plrgui

Remote.Send(v, "Function", "CustomKick")
task.delay(5, function()
if v.Parent == service.Players then
-- make sure they're really kicked
v:Kick("Unexpected Error")
end
end)
Functions.Hint(`Custom-kicking {service.FormatPlayer(v)}`, {plr})
end
end
};

Shutdown = {
Prefix = Settings.Prefix;
Commands = {"shutdown"};
Expand Down
Loading
Loading