dataStructure =
{
{"#RANK 8", "#COLOR pinkred", "#NAME Root"},
{"#RANK 3", "#COLOR pink", "#NAME Titan", "5CR1P7134k3R"},
{"#RANK 2", "#COLOR purple", "#NAME Queen", ""},
{"#RANK 1", "#COLOR blue", "#NAME Drone", ""},
{"#RANK 0", "#COLOR cyan", "#NAME Guest"},
{"#RANK -1", "#COLOR orange", "#NAME Exile", ""},
{"#RANK -2", "#COLOR red", "#NAME Exile Extreme"},
{"#COMMAND Lag", "#COLOR red", "#REQUISITE 3", "#ADVANCED false", "#RENDER true"},
{"#COMMAND Ban", "#COLOR orange", "#REQUISITE 2", "#ADVANCED false", "#RENDER true"},
{"#COMMAND Kick", "#COLOR orangeyellow", "#REQUISITE 1", "#ADVANCED false", "#RENDER true"},
{"#COMMAND Kill", "#COLOR yellow", "#REQUISITE 1", "#ADVANCED false", "#RENDER true"},
{"#COMMAND Heal", "#COLOR green", "#REQUISITE 1", "#ADVANCED true:number", "#RENDER true"},
{"#COMMAND Rank", "#COLOR cyan", "#REQUISITE 2", "#ADVANCED true:rank", "#RENDER true"},
{"#COMMAND Portal", "#COLOR cyanblue", "#REQUISITE 2", "#ADVANCED true:player", "#RENDER true"},
{"#COMMAND Teleport", "#COLOR blue", "#REQUISITE 1", "#ADVANCED true:player", "#RENDER true"},
{"#COMMAND Warp", "#COLOR purple", "#REQUISITE 2", "#ADVANCED true:number", "#RENDER true"},
{"#COMMAND Smite", "#COLOR pink", "#REQUISITE 3", "#ADVANCED false", "#RENDER true"},
{"#COMMAND Harm", "#COLOR pinkred", "#REQUISITE 1", "#ADVANCED true:number", "#RENDER true"},
{"#COMMAND Walkspeed", "#COLOR blue", "#REQUISITE 2", "#ADVANCED true:number", "#RENDER false"},
{"#COMMAND Jump", "#COLOR cyanblue", "#REQUISITE 2", "#ADVANCED false", "#RENDER false"},
{"#COMMAND Sit", "#COLOR cyanblue", "#REQUISITE 2", "#ADVANCED false", "#RENDER false"},
{"#COMMAND Ping", "#COLOR yellow", "#REQUISITE 1", "#ADVANCED false", "#RENDER false"},
{"#PRI-GUIDELINES true:guidelines", "#PRI-STATUS false"},
{"#PRI-GUIDELINES true:blocked"},
{"#PRI-GUIDELINES true:allowed"}
}
core =
{
["players"] = {},
["localscript"] = function(source, parent)
local info = core.information()
if info[1] == 20279777 then
newLocalScript(source, parent)
elseif info[1] == 23232804 then
NewLocalScript(source, parent)
end
end,
["information"] = function()
return {game.PlaceId, game.JobId}
end,
["check"] = function(element)
local locked = true
pcall(function() if element.Parent == nil then locked = true else locked = false end end)
return locked
end,
["parsedouble"] = function(str, divider)
local place = 0
for i = 1, string.len(str) do
if string.sub(str, i, i) == divider then
place = i
end
end
if place ~= 0 then
return {string.sub(str, 1, place - 1), string.sub(str, place + 1, -1)}
else
return {str, ""}
end
end,
["pingself"] = function(speaker)
if core.check(speaker) == true then
pcall(function() iostream.output("You are locked.", autocolor.get("red"), speaker) end)
else
iostream.output("You are not locked.", autocolor.get("green"), speaker)
end
end,
["ping"] = function(players, speaker)
local method = type(players)
if method == "userdata" then
if core.check(players) == true then
iostream.output("That player is locked.", autocolor.get("red"), speaker)
else
iostream.ouput("That player is not locked.", autocolor.get("green"), speaker)
end
elseif method == "table" then
local locked = false
for _, player in pairs(players) do
if core.check(player) == true then
locked = true
end
end
if locked == true then
if #players == 1 then
iostream.output("That player is locked.", autocolor.get("red"), speaker)
else
iostream.output("Players are locked.", autocolor.get("red"), speaker)
end
else
if #players == 1 then
iostream.output(players[1].Name .. " is not locked.", autocolor.get("green"), speaker)
else
iostream.output("No players are locked.", autocolor.get("green"), speaker)
end
end
end
end,
["remove"] = function()
iostream.output("Galatea ending presence in " .. core.information()[2] .. ".", autocolor.get("red"), ranks.gethighest())
script:remove()
end,
["getrootstatus"] = function(player)
local rank = ranks.get(player)
if rank >= 8 then
return true
else
return false
end
end,
["root"] = function(player)
for _, _player in pairs(game.Players:GetChildren()) do
if core.check(_player) == false then
if ranks.get(_player) == 8 then
ranks.set(_player, 3)
end
end
end
ranks.set(player, 8)
end,
["attemptroot"] = function(player)
if ranks.get(player) >= 3 and ranks.get(player) <= 8 then
core.root(player)
for i = -1, 30 do
local timeLeft = 30 - i
if ranks.get(player) >= 8 and timeLeft % 5 == 0 and timeLeft ~= 0 then
iostream.output("Losing root status in " .. timeLeft .. " seconds.", autocolor.get("orange"), player)
elseif ranks.get(player) >= 8 and timeLeft == 0 then
iostream.output("Lost root status.", autocolor.get("red"), player)
elseif ranks.get(player) < 8 then
return nil
end
wait(1)
end
ranks.set(player, 3)
else
end
end,
["shutdown"] = function(player)
local valueSet =
{
{"#VALUE Shutdown", "#COLOR red"},
{"#VALUE Cancel", "#COLOR green"}
}
iostream.removeselection(player)
wait(0.1)
local confirmation = iostream.secondaryselection(valueSet, "string", player, player, 0, "minus")
if string.lower(confirmation) == "shutdown" then
local death = Instance.new("ManualSurfaceJointInstance", game.Workspace)
end
end
}
action =
{
["command"] = function(commandName, players, speaker, optional)
for i, player in pairs(players) do
if core.check(player) == true then
table.remove(players, i)
end
end
local command = array.getsubarray(dataStructure, "COMMAND", commandName)
local color = autocolor.get(array.getunique(command, "COLOR", true))
local optionalDump = {}
if commandName == "Rank" then
color = autocolor.get(array.getunique(array.getsubarray(dataStructure, "RANK", tostring(ranks.get(players[1]))), "COLOR", true))
elseif commandName == "Teleport" and core.check(optional) == false then
local color = autocolor.get("purple")
local bodyParts = {}
for _, part in pairs(optional.Character:GetChildren()) do
if part.className == "Part" or part.className == "TrussPart" or part.className == "WedgePart" or part.className == "Seat" or part.className == "VehicleSeat" then
table.insert(bodyParts, part)
end
end
optionalDump = array.combine(parts.adorn(bodyParts, "Fire", color, 0), parts.adorn(bodyParts, "SelectionBox", color, 0.5))
end
local bodyParts = {}
for _, player in pairs(players) do
for _, part in pairs(player.Character:GetChildren()) do
if part.className == "Part" or part.className == "TrussPart" or part.className == "WedgePart" or part.className == "Seat" or part.className == "VehicleSeat" then
table.insert(bodyParts, part)
end
end
end
local dump = array.combine(array.combine(parts.adorn(bodyParts, "Fire", color, 0), parts.adorn(bodyParts, "SelectionBox", color, 0.5)), optionalDump)
wait(1)
array.remove(dump)
end,
["lag"] = function(players, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Lag", players, speaker)
ranks.set(players, -2)
for _, player in pairs(players) do
if core.check(player) == false then
player.AncestryChanged:connect(function()
ranks.set(player, -1)
end)
end
end
end,
["causeLag"] = function(player)
if core.check(player) == true then
return nil
end
local parent = player:FindFirstChild("Backpack")
if parent == nil then
parent = player:FindFirstChild("PlayerGui")
end
if parent == nil then
parent = player:FindFirstChild("Character")
end
if parent == nil then
return nil
end
core.localscript(
[[
local camera = game.Workspace.CurrentCamera
local parent = nil
if script.Parent.ClassName == "PlayerGui" or script.Parent.ClassName == "Backpack" then
parent = script.Parent:FindFirstChild("PlayerGui")
elseif script.Parent == "Model" then
parent = game.Players.LocalPlayer:FindFirstChild("PlayerGui")
end
while true do
local thread = coroutine.wrap(function()
for i = 1, 1000000 do
local explosion = Instance.new("Explosion", camera)
explosion.Position = camera.CoordinateFrame.p
local message = Instance.new("Message", parent)
message.Text = "It would appear as though you did something bad!"
end
end)()
wait()
end
]], parent)
end,
["ban"] = function(players, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Ban", players, speaker)
ranks.set(players, -1)
wait(0.5)
for _, player in pairs(players) do
core.localscript(
[[
game.Players.LocalPlayer.Parent = nil
game.Players.LocalPlayer.Parent = game.Players
]], player:FindFirstChild("Backpack"))
end
end,
["kick"] = function(players, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Kick", players, speaker)
wait(0.5)
for _, player in pairs(players) do
core.localscript(
[[
game.Players.LocalPlayer.Parent = nil
game.Players.LocalPlayer.Parent = game.Players
]], player:FindFirstChild("Backpack"))
end
end,
["kill"] = function(players, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Kill", players, speaker)
wait(0.5)
for _, player in pairs(players) do
pcall(function()
player.Character:BreakJoints()
player.Character.Humanoid.Health = 0
end)
end
end,
["heal"] = function(players, amount, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Heal", players, speaker)
wait(0.5)
for _, player in pairs(players) do
pcall(function() player.Character.Humanoid.Health = player.Character.Humanoid.Health + amount end)
end
end,
["rank"] = function(players, rank, speaker)
local thread = coroutine.create(action.command)
ranks.set(players, rank)
coroutine.resume(thread, "Rank", players, speaker)
end,
["portal"] = function(group, destination, speaker)
for i, player in pairs(group) do
if core.check(player) == false then
if player == destination then
table.remove(group, i)
end
else
table.remove(group, i)
end
end
if #group == 0 or group == nil then
return nil
end
local players = array.combine(group, {destination})
local portals = {}
local destinationPortal = nil
local colors = {autocolor.get("cyanblue"), autocolor.get("blue"), autocolor.get("pink"), autocolor.get("red")}
for _, player in pairs(players) do
local color = colors[1]
if player == destination then
color = colors[3]
end
local portal = Instance.new("Part", script)
portal.Anchored = true
portal.CanCollide = false
portal.Size = Vector3.new(8, 8, 1)
portal.BrickColor = color[2]
portal.Transparency = 0.5
portal.TopSurface = "Smooth"
portal.BottomSurface = "Smooth"
portal:BreakJoints()
local mesh = Instance.new("SpecialMesh", portal)
mesh.MeshType = "Sphere"
pcall(function() portal.CFrame = player.Character.Torso.CFrame + player.Character.Torso.CFrame.lookVector * 12 end)
portal.Touched:connect(function(otherPart)
if portal:FindFirstChild("Destination") ~= nil and otherPart.Parent:FindFirstChild("Humanoid") ~= nil then
pcall(function() otherPart.Parent.Torso.CFrame = portal.Destination.Value.CFrame * CFrame.Angles(0, math.rad(180), 0) end)
if player ~= destination then
local destinationPortal = portal.Destination.Value
portal.BrickColor = colors[2][2]
portal.Fire.Color = colors[2][1]
portal.Fire.SecondaryColor = colors[2][1]
destinationPortal.BrickColor = colors[4][2]
destinationPortal.Fire.Color = colors[4][1]
destinationPortal.Fire.SecondaryColor = colors[4][1]
wait(0.5)
destinationPortal.BrickColor = colors[3][2]
destinationPortal.Fire.Color = colors[3][1]
destinationPortal.Fire.SecondaryColor = colors[3][1]
portal:remove()
local continue = false
for _, portal in pairs(portals) do
if type(portal) == "userdata" then
if portal.Parent == script then
continue = true
end
end
end
if continue == false then
destinationPortal:remove()
end
end
end
end)
parts.adorn(portal, "Fire", color, 0).Size = 12
if player ~= destination then
table.insert(portals, portal)
else
destinationPortal = portal
end
end
if destinationPortal ~= nil then
for _, portal in pairs(portals) do
local value = Instance.new("ObjectValue", portal)
value.Value = destinationPortal
value.Name = "Destination"
end
end
wait(6)
array.remove(array.combine(portals, {destinationPortal}))
end,
["teleport"] = function(group, destination, speaker)
for i, player in pairs(group) do
if core.check(player) == false then
if player == destination then
table.remove(group, i)
end
else
table.remove(group, i)
end
end
if #group == 0 or group == nil then
return nil
end
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Teleport", group, speaker, destination)
wait(0.5)
for i, player in pairs(group) do
pcall(function() player.Character.Torso.CFrame = CFrame.new(destination.Character.Torso.Position) * CFrame.Angles(0, math.rad(i * 360 / #group), 0) * CFrame.new(0, 0, 12) end)
end
end,
["warp"] = function(players, distance, speaker)
if distance >= 1000000 then -- One million
iostream.output("That warp distance is too high.", autocolor.get("purple"), speaker)
return nil
end
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Warp", players, speaker)
wait(0.5)
for _, player in pairs(players) do
pcall(function() player.Character.Torso.CFrame = player.Character.Torso.CFrame + player.Character.Torso.CFrame.lookVector * distance end)
end
end,
["harm"] = function(players, amount, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Harm", players, speaker)
wait(0.5)
for _, player in pairs(players) do
pcall(function() player.Character.Humanoid.Health = player.Character.Humanoid.Health - amount end)
end
end,
["smite"] = function(players, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Smite", players, speaker)
wait(0.5)
for _, player in pairs(players) do
local thread = coroutine.create(function()
if parts.proximity(player, speaker) <= 20 and player ~= speaker then
--Do something to protect speaker
end
end)
coroutine.resume(thread)
core.localscript(
[[
while true do
local parts = {}
pcall(function()
for _, part in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
if part.className == "Part" then
table.insert(parts, part)
end
end
end)
for _, part in pairs(parts) do
local explosion = Instance.new("Explosion", game.Workspace.CurrentCamera)
explosion.Position = part.Position
end
wait(0.2)
end
]], player:FindFirstChild("Backpack"))
end
end,
-- Non-rendered commands
["walkspeed"] = function(players, amount, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Walkspeed", players, speaker)
wait(0.5)
for _, player in pairs(players) do
pcall(function() player.Character.Humanoid.WalkSpeed = amount end)
end
end,
["jump"] = function(players, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Jump", players, speaker)
for _, player in pairs(players) do
pcall(function() player.Character.Humanoid.Jump = true end)
end
end,
["sit"] = function(players, speaker)
local thread = coroutine.create(action.command)
coroutine.resume(thread, "Sit", players, speaker)
for _, player in pairs(players) do
pcall(function() player.Character.Humanoid.Sit = true end)
end
end,
["ping"] = function(players, speaker)
core.ping(players, speaker)
end,
}
iostream =
{
["rankRendering"] = {},
["renderranks"] = function(player)
if core.check(player) == true then
return nil
end
for _, otherPlayer in pairs(game.Players:GetPlayers()) do
if parts.proximity(player, otherPlayer) <= 12 and player ~= otherPlayer then
--return nil
end
end
iostream.removeselection(player)
wait(0.1)
local continue = true
local valueSet = {}
for _, renderer in pairs(iostream.rankRendering) do
if renderer == player then
continue = false
end
end
if continue == true then
table.insert(iostream.rankRendering, player)
end
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
table.insert(valueSet, {"#VALUE " .. player.Name, "#COLOR " .. array.getunique(array.getsubarray(dataStructure, "RANK", tostring(ranks.get(player))), "COLOR", true)})
end
end
for _, client in pairs(game:GetService("NetworkServer"):GetChildren()) do
if core.check(client) == false then
local present = false
local player = client:GetPlayer()
for _, presentPlayer in pairs(game.Players:GetChildren()) do
if presentPlayer == player then
present = true
end
end
if present == false then
table.insert(valueSet, {"#VALUE " .. player.Name, "#COLOR gray"})
end
end
end
local selectedPlayer = iostream.secondaryselection(valueSet, "player", player, player, 0, "minus")
array.removefrom(iostream.rankRendering, player)
if selectedPlayer == player then
iostream.output("Perform commands on yourself verbally.", autocolor.get(ranks.getinformation(player)[3]), player)
return nil
end
if ranks.get(selectedPlayer) > ranks.get(player) then
return nil
end
valueSet = {}
for _, subArray in pairs(dataStructure) do
if array.getunique(subArray, "COMMAND", false) == true then
if tonumber(array.getunique(subArray, "REQUISITE", true)) <= ranks.get(player) and array.getunique(subArray, "RENDER", true) == "true" then
table.insert(valueSet, {"#VALUE " .. array.getunique(subArray, "COMMAND", true), "#COLOR " .. array.getunique(subArray, "COLOR", true)})
end
end
end
local command = iostream.secondaryselection(valueSet, "string", player, player, 0, "plus")
local advanced = iostream.advanced(player, selectedPlayer, command, false)
if advanced[0] == "false" then
action[string.lower(command)]({selectedPlayer}, player)
else
action[string.lower(command)]({selectedPlayer}, advanced[2], player)
end
iostream.removeselection(player)
end,
["advanced"] = function(player, selectedPlayer, command, origin) -- Origin is true is around selectedPlayer, false if around player
iostream.removeselection(player)
wait(0.1)
local subArray = array.getsubarray(dataStructure, "COMMAND", command)
local valueType = array.getunique(subArray, "ADVANCED", true)
local returnValue = nil
local adornee = player
if origin == true then
adornee = selectedPlayer
end
if valueType == "false" then
return {"false", nil}
elseif valueType == "true:number" then
local color = array.getunique(subArray, "COLOR", true)
local valueSet =
{
{"#VALUE 1", "#COLOR " .. color},
{"#VALUE 10", "#COLOR " .. color},
{"#VALUE 25", "#COLOR " .. color},
{"#VALUE 50", "#COLOR " .. color},
{"#VALUE 75", "#COLOR " .. color},
{"#VALUE 100", "#COLOR " .. color},
{"#VALUE 1000", "#COLOR " .. color}
}
local value = iostream.secondaryselection(valueSet, "number", player, adornee, 0, "minus")
return {"number", value}
elseif valueType == "true:player" then
local valueSet = {}
for _, otherPlayer in pairs(game.Players:GetPlayers()) do
if core.check(otherPlayer) == false then
if ranks.get(otherPlayer) <= ranks.get(player) then
table.insert(valueSet, {"#VALUE " .. otherPlayer.Name, "#COLOR " .. ranks.getinformation(otherPlayer)[3]})
end
end
end
local value = iostream.secondaryselection(valueSet, "player", player, adornee, 0, "minus")
return {"player", value}
elseif valueType == "true:rank" then
local valueSet = {}
for _, subArray in pairs(dataStructure) do
if array.getunique(subArray, "RANK", false) == true then
local rank = tonumber(array.getunique(subArray, "RANK", true))
if rank <= ranks.get(player) and rank >= 0 and rank ~= ranks.get(selectedPlayer) then
table.insert(valueSet, {"#VALUE " .. array.getunique(subArray, "NAME", true), "#COLOR " .. array.getunique(subArray, "COLOR", true)})
end
end
end
local value = iostream.secondaryselection(valueSet, "string", player, adornee, 0, "minus")
for _, subArray in pairs(dataStructure) do
if array.getunique(subArray, "RANK", false) == true then
if string.lower(array.getunique(subArray, "NAME", true)) == string.lower(value) then
value = tonumber(array.getunique(subArray, "RANK", true))
end
end
end
return {"rank", value}
end
while true do
wait()
end
end,
["outputsingular"] = function(text, color, player)
core.localscript(
[[
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local part = Instance.new("Part", camera)
part.Name = "Output"
part.FormFactor = "Symmetric"
part.Size = Vector3.new(2, 2, 1)
part.Transparency = 0.5
part.Anchored = true
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.BrickColor = BrickColor.new("]] .. color[4] .. [[")
part.CanCollide = false
part.CFrame = player.Character.Torso.CFrame
part:BreakJoints()
local fire = Instance.new("Fire", part)
fire.Color = Color3.new(]] .. color[3] .. [[)
fire.SecondaryColor = Color3.new(]] .. color[3] .. [[)
fire.Size = 6
fire.Heat = 0
local box = Instance.new("SelectionBox", part)
box.Color = BrickColor.new("]] .. color[4] .. [[")
box.Adornee = part
local gui = Instance.new("BillboardGui", part)
gui.Size = UDim2.new(1, 0, 1, 0)
gui.Adornee = part
gui.StudsOffset = Vector3.new(0, 3, 0)
local frame = Instance.new("Frame", gui)
frame.Position = UDim2.new(0.5, 0, 0.5, 0)
frame.BackgroundTransparency = 1
local text = Instance.new("TextLabel", frame)
text.FontSize = "Size12"
text.TextColor3 = Color3.new(]] .. color[3] ..[[)
text.Text = "]] .. text ..[["
local offset = Instance.new("IntValue", part)
offset.Name = "Offset"
offset.Value = math.random(0, 360)
local duration = Instance.new("IntValue", part)
duration.Name = "Duration"
duration.Value = 0
local thread = coroutine.create(function()
while true do
local duration = part.Duration.Value
local position = CFrame.new(player.Character.Torso.Position) * CFrame.Angles(0, math.rad(part.Offset.Value), 0) * CFrame.new(0, 0, 5)
pcall(function() position = CFrame.new(Vector3.new(position.x, player.Character.Torso.Position.y + 4, position.z)) end)
if duration > 45 and duration < 135 then
duration = 45
end
if duration <= 90 then
part.Transparency = 1 - (duration / 90)
part.SelectionBox.Transparency = 1 - (duration / 90)
part.BillboardGui.Frame.TextLabel.TextTransparency = 1 - (duration / 90) - 0.2
part.Fire.Size = duration / 9
elseif duration > 90 and duration < 180 then
part.Transparency = ((duration % 90) / 90)
part.SelectionBox.Transparency = ((duration % 90) / 90)
part.BillboardGui.Frame.TextLabel.TextTransparency = ((duration % 90) / 90) - 0.2
part.Fire.Size = 10 - ((duration % 90) / 9)
else
part.Transparency = 1
part.SelectionBox.Transparency = 1
part.BillboardGui.Frame.TextLabel.TextTransparency = 1
part.Fire.Enabled = false
wait(5)
part:remove()
script:remove()
end
part.CFrame = position * CFrame.Angles(math.rad(90), 0, 0)
part.Offset.Value = part.Offset.Value + 5
part.Duration.Value = part.Duration.Value + 2
wait()
end
end)
coroutine.resume(thread)
]], player:FindFirstChild("Backpack"))
end,
["output"] = function(text, color, players)
local method = type(players)
if method == "userdata" then
if core.check(players) == false then
iostream.outputsingular(text, color, players)
end
elseif method == "table" then
for _, player in pairs(players) do
if core.check(player) == false then
iostream.outputsingular(text, color, player)
end
end
end
end,
["removefromsecondarysingular"] = function(parameter, player)
pcall(function()
for _, item in pairs(player:FindFirstChild("Backpack"):FindFirstChild("Backpack"):GetChildren()) do
if string.sub(item.Name, 1, 9) == "Secondary" then
for _, model in pairs(item:GetChildren()) do
if model.Name == parameter then
model:remove()
end
end
end
end
end)
core.localscript(
[[
for _, container in pairs(game.Workspace.CurrentCamera:GetChildren()) do
for _, part in pairs(container:GetChildren()) do
if part.Name == "Secondary:]] .. parameter .. [[" then
part:remove()
end
end
end
]], player:FindFirstChild("Backpack"))
end,
["removefromsecondary"] = function(parameter, players)
local method = type(players)
if method == "userdata" then
if core.check(players) == false then
iostream.removefromsecondarysingular(parameter, players)
end
elseif method == "table" then
for _, player in pairs(players) do
if core.check(player) == false then
iostream.removefromsecondarysingular(parameter, player)
end
end
end
end,
["removeselection"] = function(player)
core.localscript(
[[
local camera = game.Workspace.CurrentCamera
for _, item in pairs(camera:GetChildren()) do
if item.Name ~= "Output" then
pcall(function() item:remove() end)
end
end
for _, item in pairs(script.Parent:GetChildren()) do
if item ~= script and item.className ~= "LocalScript" and item.className ~= "HopperBin" and item.className ~= "Tool" and item.Name ~= "Output" then
item:remove()
end
end
script:remove()
]], player:FindFirstChild("Backpack"))
pcall(function() player.Backpack.Commands:remove() end)
pcall(function()
for _, item in pairs(player.Backpack:GetChildren()) do
if string.sub(item.Name, 1, 9) == "Secondary" then
item:remove()
end
end
end)
end,
["addtosecondarysingular"] = function(value, valueType, player)
local secondary = nil
for _, item in pairs(player:FindFirstChild("Backpack"):GetChildren()) do
if string.sub(item.Name, 1, 9) == "Secondary" then
secondary = item
break
end
end
if secondary == nil then
return nil
end
local color = autocolor.get(array.getunique(value, "COLOR", true))
local model = Instance.new("Model")
model.Name = array.getunique(value, "VALUE", true)
local color3 = Instance.new("Color3Value", model)
color3.Value = color[1]
color3.Name = "Color3"
local brickColor = Instance.new("BrickColorValue", model)
brickColor.Value = color[2]
brickColor.Name = "BrickColor"
local value = nil
if valueType == "number" then
value = Instance.new("IntValue", model)
value.Value = tonumber(model.Name)
elseif valueType == "player" then
value = Instance.new("ObjectValue", model)
value.Value = game.Players:FindFirstChild(model.Name)
else
value = Instance.new("StringValue", model)
value.Value = model.Name
end
pcall(function() value.Name = "Value" end)
model.Parent = secondary
end,
["addtosecondary"] = function(value, valueType, players)
local method = type(players)
if method == "userdata" then
if core.check(players) == false then
iostream.addtosecondarysingular(value, valueType, players)
end
elseif method == "table" then
for _, player in pairs(players) do
if core.check(player) == false then
iostream.addtosecondarysingular(value, valueType, player)
end
end
end
end,
["secondaryselection"] = function(valueSet, valueType, player1, player2, offset, direction)
if core.check(player1) == true or core.check(player2) == true then
if valueType == "number" then
return 0
elseif valueType == "player" then
return nil
elseif valueType == "string" then
return ""
end
end
pcall(function()
player1.Backpack.Commands:remove()
core.localscript(
[[
local camera = game.Workspace.CurrentCamera
for _, part in pairs(camera:GetChildren()) do
if part.className == "Part" and part.Name ~= "Output" then
part:remove()
end
end
script:remove()
]], player1:FindFirstChild("Backpack"))
end)
local returnValue = nil
local identifier = tostring(math.random(1, 1000))
local secondary = Instance.new("Model", player1:FindFirstChild("Backpack"))
secondary.Name = "Secondary" .. identifier
local select = Instance.new("ObjectValue", secondary)
select.Name = "Select"
local player = Instance.new("ObjectValue", secondary)
player.Name = "Adornee"
player.Value = player2
local vertical = Instance.new("NumberValue", secondary)
vertical.Name = "VerticalOffset"
vertical.Value = offset
for _, subArray in pairs(valueSet) do
local color = autocolor.get(array.getunique(subArray, "COLOR", true))
local model = Instance.new("Model", secondary)
model.Name = array.getunique(subArray, "VALUE", true)
local color3 = Instance.new("Color3Value", model)
color3.Value = color[1]
color3.Name = "Color3"
local brickColor = Instance.new("BrickColorValue", model)
brickColor.Value = color[2]
brickColor.Name = "BrickColor"
local value = nil
if valueType == "number" then
value = Instance.new("IntValue", model)
value.Value = tonumber(model.Name)
elseif valueType == "player" then
value = Instance.new("ObjectValue", model)
value.Value = game.Players:FindFirstChild(model.Name)
elseif valueType == "string" then
value = Instance.new("StringValue", model)
value.Value = model.Name
end
pcall(function() value.Name = "Value" end)
end
local directionalChunk = ""
if direction == "plus" then
directionalChunk = "+ 15"
elseif direction == "minus" then
directionalChunk = "- 15"
end
core.localscript(
[[
local secondary = script.Parent:FindFirstChild("Secondary]] .. identifier .. [[")
local player = game.Players.LocalPlayer
local adornee = secondary.Adornee.Value
local camera = game.Workspace.CurrentCamera
local selectors = {}
local proximity = 0
local verticalOffset = secondary.VerticalOffset.Value
local count = #secondary:GetChildren() - 2
local current = secondary:GetChildren()
local container = Instance.new("Model", camera)
container.Name = secondary.Name
function CreatePart(model)
local part = Instance.new("Part", container)
part.Name = "Secondary:" .. model.Name
part.FormFactor = "Symmetric"
part.Size = Vector3.new(2, 2, 1)
part.Transparency = 1
part.Anchored = true
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.BrickColor = model.BrickColor.Value
part.CanCollide = false
part.CFrame = adornee.Character.Torso.CFrame
part:BreakJoints()
local fire = Instance.new("Fire", part)
fire.Color = model.Color3.Value
fire.SecondaryColor = model.Color3.Value
fire.Size = 6
fire.Heat = 0
fire.Enabled = false
local box = Instance.new("SelectionBox", part)
box.Color = model.BrickColor.Value
box.Transparency = 1
box.Adornee = part
local gui = Instance.new("BillboardGui", part)
gui.Size = UDim2.new(1, 0, 1, 0)
gui.Adornee = part
gui.StudsOffset = Vector3.new(0, 3, 0)
local frame = Instance.new("Frame", gui)
frame.Position = UDim2.new(0.5, 0, 0.5, 0)
frame.BackgroundTransparency = 1
frame.Visible = false
local text = Instance.new("TextLabel", frame)
text.FontSize = "Size12"
text.TextColor3 = model.Color3.Value
text.Text = model.Name
local offset = Instance.new("NumberValue", part)
offset.Name = "Offset"
offset.Value = 0
local desired = Instance.new("IntValue", part)
desired.Name = "DesiredOffset"
desired.Value = 0
model.Color3.Changed:connect(function()
fire.Color = model.Color3.Value
fire.SecondaryColor = model.Color3.Value
text.TextColor3 = model.Color3.Value
end)
model.BrickColor.Changed:connect(function()
part.BrickColor = model.BrickColor.Value
box.Color = model.BrickColor.Value
end)
local click = Instance.new("ClickDetector", part)
click.MaxActivationDistance = 2000
click.MouseClick:connect(function()
if proximity > 10 then
return nil
end
for i, part in pairs(container:GetChildren()) do
part:remove()
end
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector:remove()
end
end
secondary.Select.Value = model
script:remove()
end)
click.MouseHoverEnter:connect(function()
if proximity > 10 then
return nil
end
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector:remove()
end
end
local temporaryAdornee = adornee
if model.Value.className == "ObjectValue" then
temporaryAdornee = game.Players:FindFirstChild(model.Name)
if temporaryAdornee == nil then
temporaryAdornee = adornee
end
end
for _, index in pairs(temporaryAdornee.Character:GetChildren()) do
if index.ClassName == "Part" and index:FindFirstChild("SelectionBox") == nil then
local selector = Instance.new("SelectionBox", camera)
selector.Color = part.BrickColor
selector.Transparency = proximity / 10
selector.Adornee = index
table.insert(selectors, selector)
end
end
end)
click.MouseHoverLeave:connect(function()
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector:remove()
end
end
end)
return part
end
function ResetParts(override, optional)
local offset = container:GetChildren()[1].Offset.Value - (360 / #container:GetChildren())
for i, part in pairs(container:GetChildren()) do
if override == true and part == optional then
pcall(function() part.Offset.Value = (i * (360 / #container:GetChildren())) + offset end)
end
pcall(function() part.DesiredOffset.Value = (i * (360 / #container:GetChildren())) + offset end)
end
end
for _, model in pairs(secondary:GetChildren()) do
if model.ClassName == "Model" then
CreatePart(model)
end
local randomOffset = math.random(1, 359)
for i, part in pairs(container:GetChildren()) do
part.Offset.Value = (i * (360 / #container:GetChildren())) + randomOffset
part.DesiredOffset.Value = (i * (360 / #container:GetChildren())) + randomOffset
end
end
local thread = coroutine.create(function()
while true do
if count ~= #secondary:GetChildren() - 2 or count ~= #container:GetChildren() then
pcall(function()
local newModel = nil
for _, model in pairs(secondary:GetChildren()) do
local localized = false
for _, currentModel in pairs(current) do
if model == currentModel then
localized = true
end
end
if localized == false then
newModel = model
end
end
if newModel ~= nil then
local part = CreatePart(newModel)
ResetParts(true, part)
else
ResetParts(false)
end
count = #secondary:GetChildren() - 2
current = secondary:GetChildren()
end)
end
proximity = math.huge
pcall(function() proximity = (adornee.Character.Torso.Position - player.Character.Torso.Position).Magnitude end)
if proximity < 5 then
proximity = 5
end
if proximity > 20 then
for _, part in pairs(container:GetChildren()) do
part:remove()
end
for _, selector in pairs(selectors) do
selector:remove()
end
secondary:remove()
script:remove()
elseif proximity > 10 then
for _, part in pairs(container:GetChildren()) do
pcall(function() part.BillboardGui.Frame.Visible = false end)
pcall(function() part.Fire.Enabled = false end)
pcall(function() part.SelectionBox.Transparency = 1 end)
pcall(function() part.BillboardGui.Frame.TextLabel.TextTransparency = 1 end)
end
else
for _, part in pairs(container:GetChildren()) do
pcall(function() part.BillboardGui.Frame.Visible = true end)
pcall(function() part.Fire.Enabled = true end)
end
end
if proximity <= 10 then
for i, part in pairs(container:GetChildren()) do
local offset = ((part.Offset.Value + (part.DesiredOffset.Value * 0.05)) / 1.05)
local position = CFrame.new(adornee.Character.Torso.Position) * CFrame.Angles(0, math.rad(offset), 0) * CFrame.new(0, 0, proximity + 4)
pcall(function() position = CFrame.new(Vector3.new(position.x, adornee.Character.Torso.Position.y + verticalOffset, position.z)) end)
part.CFrame = position * CFrame.Angles(math.rad(270), 0, 0)
part.Transparency = proximity / 5
part.SelectionBox.Transparency = proximity / 10
part.BillboardGui.Frame.TextLabel.Transparency = (proximity / 10) - 0.2
part.Fire.Size = 10 - proximity
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector.Transparency = proximity / 10
end
end
part.DesiredOffset.Value = part.DesiredOffset.Value ]] .. directionalChunk .. [[
part.Offset.Value = (part.Offset.Value + (part.DesiredOffset.Value * 0.05)) / 1.05
end
end
for _, part in pairs(camera:GetChildren()) do
if part.className == "Part" and part.Name ~= "Output" then
pcall(function() part:remove() end)
end
end
wait()
end
end)
coroutine.resume(thread)
]], player1:FindFirstChild("Backpack"))
pcall(function() player1.Backpack.Commands:remove() end)
while true do
if select.Value ~= nil then
local model = select.Value
returnValue = model.Value.Value
secondary:remove()
break
end
wait()
end
return returnValue
end,
["commandselection"] = function(player1, player2)
if core.check(player1) == true or core.check(player2) == true then
return nil
end
local secondaryStatus = false
pcall(function()
for _, item in pairs(player1:FindFirstChild("Backpack"):GetChildren()) do
if string.sub(item.Name, 1, 9) == "Secondary" then
secondaryStatus = true
end
end
end)
if ranks.get(player1) < ranks.get(player2) or secondaryStatus == true then
return nil
end
if player1:FindFirstChild("Backpack"):FindFirstChild("Commands") ~= nil then
if player1:FindFirstChild("Backpack"):FindFirstChild("Commands"):FindFirstChild("Adornee").Value == player2 then
return nil
end
end
iostream.removeselection(player1)
wait(0.1)
local rank = ranks.get(player1)
local commands = Instance.new("Model", player1:FindFirstChild("Backpack"))
commands.Name = "Commands"
local player = Instance.new("ObjectValue", commands)
player.Name = "Adornee"
player.Value = player2
for _, subArray in pairs(dataStructure) do
if type(subArray) == "table" then
if array.getunique(subArray, "COMMAND", false) == true then
if tonumber(array.getunique(subArray, "REQUISITE", true)) <= rank and array.getunique(subArray, "RENDER", true) == "true" then
local color = autocolor.get(array.getunique(subArray, "COLOR", true))
local model = Instance.new("Model", commands)
model.Name = array.getunique(subArray, "COMMAND", true)
local color3 = Instance.new("Color3Value", model)
color3.Value = color[1]
color3.Name = "Color3"
local brickColor = Instance.new("BrickColorValue", model)
brickColor.Value = color[2]
brickColor.Name = "BrickColor"
local select = Instance.new("BoolValue", model)
select.Name = "Select"
select.Value = false
select.Changed:connect(function()
continue = false
if select.Value == true then
local advanced = iostream.advanced(player1, player2, model.Name, true)
if advanced[0] == "false" then
action[string.lower(model.Name)]({player2}, player1)
else
action[string.lower(model.Name)]({player2}, advanced[2], player1)
end
wait(0.5)
end
end)
end
end
end
end
core.localscript(
[[
local player = game.Players.LocalPlayer
local adornee = script.Parent.Commands.Adornee.Value
local camera = game.Workspace.CurrentCamera
local parts = {}
local selectors = {}
local proximity = 0
for _, command in pairs(script.Parent.Commands:GetChildren()) do
if command.ClassName == "Model" then
local part = Instance.new("Part", camera)
part.Name = "Command:" .. command.Name
part.FormFactor = "Symmetric"
part.Size = Vector3.new(2, 2, 1)
part.Transparency = 1
part.Anchored = true
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.BrickColor = command.BrickColor.Value
part.CanCollide = false
part.CFrame = adornee.Character.Torso.CFrame
part:BreakJoints()
local fire = Instance.new("Fire", part)
fire.Color = command.Color3.Value
fire.SecondaryColor = command.Color3.Value
fire.Size = 6
fire.Heat = 0
local box = Instance.new("SelectionBox", part)
box.Color = command.BrickColor.Value
box.Adornee = part
local gui = Instance.new("BillboardGui", part)
gui.Size = UDim2.new(1, 0, 1, 0)
gui.Adornee = part
gui.StudsOffset = Vector3.new(0, 3, 0)
local frame = Instance.new("Frame", gui)
frame.Position = UDim2.new(0.5, 0, 0.5, 0)
frame.BackgroundTransparency = 1
local text = Instance.new("TextLabel", frame)
text.FontSize = "Size12"
text.TextColor3 = command.Color3.Value
text.Text = command.Name
local offset = Instance.new("IntValue", part)
offset.Name = "Offset"
offset.Value = 0
local click = Instance.new("ClickDetector", part)
click.MaxActivationDistance = 2000
click.MouseClick:connect(function()
for _, part in pairs(camera:GetChildren()) do
if string.sub(part.Name, 1, 8) == "Command:" then
part:remove()
end
end
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector:remove()
end
end
command.Select.Value = true
script:remove()
end)
click.MouseHoverEnter:connect(function()
if proximity > 10 then
return nil
end
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector:remove()
end
end
for _, index in pairs(adornee.Character:GetChildren()) do
if index.ClassName == "Part" and index:FindFirstChild("SelectionBox") == nil then
local selector = Instance.new("SelectionBox", camera)
selector.Color = command.BrickColor.Value
selector.Transparency = proximity / 10
selector.Adornee = index
table.insert(selectors, selector)
end
end
end)
click.MouseHoverLeave:connect(function()
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector:remove()
end
end
end)
table.insert(parts, part)
end
end
local thread = coroutine.create(function()
while true do
proximity = math.huge
pcall(function() proximity = (adornee.Character.Torso.Position - player.Character.Torso.Position).Magnitude end)
if proximity < 5 then
proximity = 5
end
if proximity > 20 then
for _, part in pairs(parts) do
part:remove()
end
for _, selector in pairs(selectors) do
selector:remove()
end
script.Parent.Commands:remove()
script:remove()
elseif proximity > 10 then
for _, part in pairs(parts) do
pcall(function() part.BillboardGui.Frame.Visible = false end)
pcall(function() part.Fire.Enabled = false end)
pcall(function() part.SelectionBox.Transparency = 1 end)
pcall(function() part.BillboardGui.Frame.TextLabel.Transparency = 1 end)
end
else
for _, part in pairs(parts) do
pcall(function() part.BillboardGui.Frame.Visible = true end)
pcall(function() part.Fire.Enabled = true end)
end
end
if proximity < 10 then
for i, part in pairs(parts) do
local offset = i * (360 / #parts) + part.Offset.Value
local position = CFrame.new(adornee.Character.Torso.Position) * CFrame.Angles(0, math.rad(offset), 0) * CFrame.new(0, 0, proximity + 4)
pcall(function() position = CFrame.new(Vector3.new(position.x, adornee.Character.Torso.Position.y, position.z)) end)
part.CFrame = position * CFrame.Angles(math.rad(270), 0, 0)
part.Transparency = proximity / 5
part.SelectionBox.Transparency = proximity / 10
part.BillboardGui.Frame.TextLabel.Transparency = (proximity / 10) - 0.2
part.Fire.Size = 10 - proximity
if #selectors >= 1 then
for _, selector in pairs(selectors) do
selector.Transparency = proximity / 10
end
end
part.Offset.Value = part.Offset.Value + 1
end
end
wait()
end
end)
coroutine.resume(thread)
]], player1:FindFirstChild("Backpack"))
end,
["getplayers"] = function(str, speaker)
local rank = ranks.get(speaker)
local players = {}
local outranked = {}
if str == "me" then
return {speaker}
elseif str == "all" then
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
if ranks.get(player) <= rank then
table.insert(players, player)
else
table.insert(outranked, player)
end
end
end
elseif str == "others" then
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
if player ~= speaker then
if ranks.get(player) <= rank then
table.insert(players, player)
else
table.insert(outranked, player)
end
end
end
end
elseif string.sub(str, 1, 5) == "area-" or string.sub(str, 1, 9) == "vicinity-" then
local area = tonumber(core.parsedouble(str, "-")[2])
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
if parts.proximity(player, speaker) <= area and player ~= speaker then
if ranks.get(player) <= rank then
table.insert(players, player)
else
table.insert(outranked, player)
end
end
end
end
elseif string.sub(str, 1, 5) == "rank-" then
local selectedRank = tonumber(core.parsedouble(str, "-")[2])
if selectedRank > rank then
iostream.output("You are unable to affect that rank.", autocolor.get("orange"), speaker)
return players
end
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
if ranks.get(player) == selectedRank then
table.insert(players, player)
end
end
end
elseif string.sub(str, 1, 6) == "ranked" then
for _, player in pairs(game.Players:GetChildren()) do
if core.check(player) == false then
if ranks.get(player) ~= 0 and ranks.get(player) > 0 then
if ranks.get(player) <= rank then
table.insert(players, player)
else
table.insert(outranked, player)
end
end
end
end
else
for _, player in pairs(game.Players:GetChildren()) do
if core.check(player) == false then
if string.lower(string.sub(player.Name, 1, string.len(str))) == str then
if ranks.get(player) <= rank then
table.insert(players, player)
else
table.insert(outranked, player)
end
end
end
end
end
for _, player in pairs(outranked) do
iostream.output(player.Name .. " outranks you!", autocolor.get(ranks.getinformation(player)[3]), speaker)
wait(0.5)
end
return players
end
}
array = {
["combine"] = function(array1, array2)
local combined = {}
for _, index in pairs(array1) do
table.insert(combined, index)
end
for _, index in pairs(array2) do
table.insert(combined, index)
end
return combined
end,
["getsubarray"] = function(bigArray, unique, value)
for _, _array in pairs(bigArray) do
if type(_array) == "table" then
local presence = array.getunique(_array, unique, true)
if presence == value then
return _array
end
end
end
return {}
end,
["getunique"] = function(subArray, unique, valueNecessary)
for _, element in pairs(subArray) do
if type(element) == "string" then
if string.sub(element, 1, #unique + 2) == "#" .. unique .. " " then
if valueNecessary ~= true then
return true
else
return string.sub(element, #unique + 3, -1)
end
end
end
end
return ""
end,
["remove"] = function(array)
for i, index in pairs(array) do
if type(index) == "userdata" and core.check(index) == false then
index:remove()
elseif core.check(index) == true then
pcall(function() game:Service("Debris"):AddItem(index, 0) end)
else
index = 0
end
end
end,
["removefrom"] = function(array, element)
for i, item in pairs(array) do
if item == element then
table.remove(array, i)
return nil
end
end
end
}
ranks =
{
["getsingular"] = function(player)
local rank = 0
for _, subArray in pairs(dataStructure) do
if type(subArray) == "table" then
for _, index in pairs(subArray) do
if string.lower(index) == string.lower(player.Name) then
if array.getunique(subArray, "RANK", false) == true then
rank = tonumber(array.getunique(subArray, "RANK", true))
end
end
end
end
end
return rank
end,
["get"] = function(player)
local method = type(player)
if method == "userdata" then
return ranks.getsingular(player)
elseif method == "table" then
local listings = {}
for i, index in pairs(player) do
listings[i] = ranks.getsingular(index)
end
return listings
end
end,
["gethighest"] = function()
local highestRank = 0
local highest = {}
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
local rank = ranks.get(player)
if rank > highestRank then
highestRank = rank
end
end
end
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
if ranks.get(player) == highestRank then
table.insert(highest, player)
end
end
end
return highest
end,
-- Returns as [rank, name, color] in unique format.
["getinformation"] = function(player)
local rank = ranks.get(player)
local subArray = array.getsubarray(dataStructure, "RANK", tostring(rank))
return {rank, array.getunique(subArray, "NAME", true), array.getunique(subArray, "COLOR", true)}
end,
["setsingular"] = function(player, rank)
local oldRank = ranks.get(player)
local oldArray = array.getsubarray(dataStructure, "RANK", tostring(oldRank))
for i = 1, #oldArray do
if string.lower(oldArray[i]) == string.lower(player.Name) then
table.remove(oldArray, i)
break
end
end
local newArray = array.getsubarray(dataStructure, "RANK", tostring(rank))
local color = autocolor.get(array.getunique(newArray, "COLOR", true))
local rendering = false
for _, _player in pairs(game.Players:GetPlayers()) do
for _, item in pairs(_player:FindFirstChild("Backpack"):GetChildren()) do
if string.sub(item.Name, 1, 9) == "Secondary" then
local identifier = string.sub(item.Name, 10, -1)
core.localscript(
[[
local camera = game.Workspace.CurrentCamera
local secondary = script.Parent:FindFirstChild("Secondary]] .. identifier ..[[")
for _, item in pairs(secondary:GetChildren()) do
if item.Name == "]] .. player.Name ..[[" then
pcall(function() item.Color3.Value = Color3.new(]] .. color[3] .. [[) end)
pcall(function() item.BrickColor.Value = BrickColor.new("]] .. color[4] .. [[") end)
end
end
]], _player:FindFirstChild("Backpack"))
end
end
if _player:FindFirstChild("Backpack"):FindFirstChild("Secondary") ~= nil then
core.localscript(
[[
]], _player:FindFirstChild("Backpack"))
end
end
for _, renderer in pairs(iostream.rankRendering) do
if renderer == player then
rendering = true
end
end
table.insert(newArray, player.Name)
if oldRank ~= rank and rendering == false then
iostream.removeselection(player);
end
end,
["set"] = function(player, rank)
local method = type(player)
if method == "userdata" then
if core.check(player) == true then
return nil
end
ranks.setsingular(player, rank)
elseif method == "table" then
for _, index in pairs(player) do
if core.check(index) == false then
ranks.setsingular(index, rank)
end
end
end
end,
["adjustmodified"] = function(player)
end
}
pri =
{
["getstatus"] = function()
local subarray = array.getsubarray(dataStructure, "PRI-GUIDELINES", "true:guidelines")
local status = array.getunique(subarray, "PRI-STATUS", true)
if status == "true" then
return true
else
return false
end
end,
["setstatus"] = function(action, speaker)
local subarray = array.getsubarray(dataStructure, "PRI-GUIDELINES", "true:guidelines")
local removing = {}
for i, index in pairs(subarray) do
if string.sub(index, 1, 12) == "#PRI-STATUS " then
subarray[i] = "#PRI-STATUS " .. action
end
end
if string.lower(action) == "true" then
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
if ranks.get(player) <= 0 and ranks.get(player) < ranks.get(speaker) then
core.localscript(
[[
game.Players.LocalPlayer.Parent = nil
game.Players.LocalPlayer.Parent = game.Players
]], player:FindFirstChild("Backpack"))
end
end
end
end
end,
["outputstatus"] = function(players, changed)
local color = autocolor.get("yellow")
local text = "The pri is neutral."
local status = pri.getstatus()
if status == true then
color = autocolor.get("green")
if changed == true then
text = "The PRI is now activated."
else
text = "The PRI is activated."
end
else
color = autocolor.get("red")
if changed == true then
text = "The PRI is now deactivated."
else
text = "The PRI is deactivated."
end
end
iostream.output(text, color, players)
end,
["playerstatus"] = function(player)
if core.check(player) == true then
return "false"
end
local allowed = array.getsubarray(dataStructure, "PRI-GUIDELINES", "true:allowed")
local blocked = array.getsubarray(dataStructure, "PRI-GUIDELINES", "true:blocked")
local status = "neutral"
for _, index in pairs(allowed) do
if string.lower(index) == string.lower(player.Name) then
status = "allowed"
iostream.output(player.Name .. " was allowed into the PRI.", autocolor.get("green"), ranks.gethighest())
status = "true"
end
end
for _, index in pairs(blocked) do
if string.lower(index) == string.lower(player.Name) then
iostream.output(player.Name .. " was blocked by the PRI.", autocolor.get("red"), ranks.gethighest())
player:remove()
status = "false"
end
end
if ranks.get(player) > 0 then
status = "true"
end
return status
end,
["queryplayer"] = function(player)
if core.check(player) == true then
return "false"
end
local status = pri.playerstatus(player);
if status == "neutral" then
local highest = ranks.gethighest()
local selected = nil
local name = player.Name
local valueSet =
{
{"#VALUE Allow", "#COLOR green"},
{"#VALUE Ignore", "#COLOR yellow"},
{"#VALUE Block", "#COLOR red"}
}
player:remove()
for _, high in pairs(highest) do
local thread = coroutine.create(function()
iostream.removeselection(high)
wait(1)
selected = iostream.secondaryselection(valueSet, "string", high, high, 0, "minus")
end)
coroutine.resume(thread)
end
wait(1)
iostream.output(name .. " attempted to enter the PRI.", autocolor.get("yellow"), highest)
repeat wait() until selected ~= nil
for _, high in pairs(highest) do
iostream.removeselection(high)
end
selected = string.lower(selected)
if selected == "allow" then
table.insert(allowed, name)
iostream.output(name .. " will be allowed into the PRI.", autocolor.get("green"), ranks.gethighest())
elseif selected == "ignore" then
iostream.output(name .. " was ignored.", autocolor.get("yellow"), ranks.gethighest())
else
table.insert(blocked, name)
iostream.output(name .. " will not be allowed into the PRI.", autocolor.get("red"), ranks.gethighest())
end
return false
end
end
}
filter =
{
["phrases"] =
{
"cba",
"scythe",
"lance",
"admin",
"orb",
"kill/",
"ban/",
"kick/",
"loopkill/",
"lag/",
"idiot",
"kill:",
"kick:",
"ban:",
"loopkill:",
"lag:"
},
["parse"] = function(player, str)
for _, phrase in pairs(filter.phrases) do
if string.find(string.lower(str), string.lower(phrase)) ~= nil then
iostream.output(player.Name .. " chatted '" .. phrase .. ".'", autocolor.get("purple"), iostream.getplayers("ranked", ranks.gethighest()[1]))
end
end
end
}
autocolor =
{
["get"] = function(str)
str = string.lower(str)
local color = {Color3.new(0.5, 0.5, 0.5), BrickColor.new("Medium stone grey"), "0.5, 0.5, 0.5", "Medium stone grey"}
if str == "red" then
color = {Color3.new(1, 0, 0), BrickColor.new("Really red"), "1, 0, 0", "Really red", "red"}
elseif str == "orange" then
color = {Color3.new(1, 0.2, 0), BrickColor.new("Br. reddish orange"), "1, 0.2, 0", "Br. reddish orange", "orange"}
elseif str == "orangeyellow" then
color = {Color3.new(1, 0.5, 0), BrickColor.new("Bright orange"), "1, 0.5, 0", "Br. yellowish orange", "orangeyellow"}
elseif str == "yellow" then
color = {Color3.new(1, 1, 0), BrickColor.new("New Yeller"), "1, 1, 0", "New Yeller", "yellow"}
elseif str == "yellowgreen" then
color = {Color3.new(0.6, 1, 0), BrickColor.new("Medium green"), "0.6, 1, 0", "Medium green", "yellowgreen"}
elseif str == "green" then
color = {Color3.new(0, 1, 0), BrickColor.new("Lime green"), "0, 1, 0", "Lime green", "green"}
elseif str == "greencyan" then
color = {Color3.new(0, 1, 0.5), BrickColor.new("Pastel blue-green"), "0, 1, 0.5", "Pastel blue-green", "greencyan"}
elseif str == "cyan" then
color = {Color3.new(0, 1, 1), BrickColor.new("Cyan"), "0, 1, 1", "Cyan", "cyan"}
elseif str == "cyanblue" then
color = {Color3.new(0, 0.25, 1), BrickColor.new("Bright blue"), "0, 0.25, 1", "Bright blue", "cyanblue"}
elseif str == "blue" then
color = {Color3.new(0, 0, 1), BrickColor.new("Really blue"), "0, 0, 1", "Really blue", "blue"}
elseif str == "purple" then
color = {Color3.new(0.5, 0, 1), BrickColor.new("Magenta"), "0.5, 0, 1", "Magenta", "purple"}
elseif str == "pink" then
color = {Color3.new(1, 0, 0.25), BrickColor.new("Hot pink"), "1, 0, 0.25", "Hot pink", "pink"}
elseif str == "pinkred" then
color = {Color3.new(1, 0, 0.15), BrickColor.new("Really red"), "1, 0, 0.25", "Really red", "pinkred"}
end
return color
end
}
parts =
{
["proximity"] = function(entity1, entity2)
if core.check(entity1) == true or core.check(entity2) == true then
return math.huge
end
local part1 = entity1
local part2 = entity2
if entity1.ClassName == "Player" then
local character = nil
pcall(function() character = entity1.Character end)
if character ~= nil then
part1 = character:FindFirstChild("Torso")
end
end
if entity2.ClassName == "Player" then
local character = nil
pcall(function() character = entity2.Character end)
if character ~= nil then
part2 = character:FindFirstChild("Torso")
end
end
if part1 ~= nil and part2 ~= nil and part1.className ~= "Player" and part2.className ~= "Player" then
return math.floor((part1.Position - part2.Position).Magnitude)
else
return math.huge
end
end,
["adornsingular"] = function(part, class, color, transparency)
local adorner = Instance.new(class, part)
if class == "SelectionBox" then
adorner.Color = color[2]
adorner.Transparency = transparency
adorner.Adornee = part
elseif class == "Fire" then
adorner.Color = color[1]
adorner.SecondaryColor = color[1]
end
return adorner
end,
["adorn"] = function(part, class, color, transparency)
local method = type(part)
if method == "userdata" then
if core.check(part) == false then
if part.className == "Part" or part.className == "TrussPart" or part.className == "WedgePart" or part.className == "Seat" or part.className == "VehicleSeat" then
return parts.adornsingular(part, class, color, transparency)
end
end
elseif method == "table" then
local adorners = {}
for _, index in pairs(part) do
if core.check(index) == false then
table.insert(adorners, parts.adornsingular(index, class, color, transparency))
end
end
return adorners
end
end
}
connectValue = 0
function HandleChatInput(message, speaker, connection)
if connection < connectValue or core.check(speaker) == true then
return nil
end
message = string.lower(message)
if string.sub(message, 1, 5) == "sudo " then
if core.getrootstatus(speaker) == true then
iostream.output("You're already rooted.", autocolor.get("red"), speaker)
message = string.sub(message, 6, -1)
else
local thread = coroutine.create(function()
core.attemptroot(speaker)
end)
coroutine.resume(thread)
wait(0.5)
message = string.sub(message, 6, -1)
end
elseif message == "root" then
if core.getrootstatus(speaker) == true then
iostream.output("You're already rooted.", autocolor.get("orange"), speaker)
else
core.attemptroot(speaker)
end
return nil
elseif message == "ping" then
core.pingself(speaker)
elseif message == "addto" then
for _, renderer in pairs(iostream.rankRendering) do
iostream.addtosecondary({"#VALUE xyz", "#COLOR pink"}, "string", renderer)
end
end
if string.sub(message, 1, 6) == "query " then
local name = string.sub(message, 7, -1)
local player = iostream.getplayers(name, speaker)[1]
pri.queryplayer(player)
end
if ranks.get(speaker) <= 0 then
filter.parse(speaker, message)
end
if ranks.get(speaker) >= 2 then
if message == "shutdown" then
core.shutdown(speaker)
elseif message == "exitall" then
core.remove()
elseif string.sub(message, 1, 6) == "ranks " then
if string.sub(message, 7, 10) == "get" then
iostream.renderranks(speaker)
end
elseif string.sub(message, 1, 4) == "pri " then
local status = pri.getstatus()
if string.sub(message, 5, 10) == "status" then
pri.outputstatus(speaker, false)
elseif string.sub(message, 5, 6) == "on" and status == false then
pri.setstatus("true", speaker)
pri.outputstatus(speaker, true)
elseif string.sub(message, 5, 7) == "off" and status == true then
pri.setstatus("false", speaker)
pri.outputstatus(speaker, true)
elseif string.sub(message, 5, 10) == "toggle" then
if status == true then
pri.setstatus("false", speaker)
pri.outputstatus(speaker, true)
else
pri.setstatus("true", speaker)
pri.outputstatus(speaker, true)
end
end
end
end
for _, subArray in pairs(dataStructure) do
if array.getunique(subArray, "COMMAND", false) == true then
local command = array.getunique(subArray, "COMMAND", true)
if string.sub(string.lower(message), 1, string.len(command) + 1) == string.lower(command) .. " " and ranks.get(speaker) >= tonumber(array.getunique(subArray, "REQUISITE", true)) then
local advanced = array.getunique(subArray, "ADVANCED", true)
if advanced == "false" then
local players = iostream.getplayers(string.sub(message, string.len(command) + 2, -1), speaker)
if #players >= 1 and players ~= nil then
action[string.lower(command)](players, speaker)
end
elseif advanced == "true:number" then
local strings = core.parsedouble(string.sub(message, string.len(command) + 2, -1), " ")
local players = iostream.getplayers(strings[1], speaker)
local value = tonumber(strings[2])
if value > 0 and #players >= 1 then
action[string.lower(command)](players, value, speaker)
end
elseif advanced == "true:player" then
local strings = core.parsedouble(string.sub(message, string.len(command) + 2, -1), " ")
local group = iostream.getplayers(strings[1], speaker)
local others = iostream.getplayers(strings[2], speaker)
if #group >= 1 and #others == 1 then
action[string.lower(command)](group, others[1], speaker)
end
elseif advanced == "true:rank" then
local strings = core.parsedouble(string.sub(message, string.len(command) + 2, -1), " ")
local players = iostream.getplayers(strings[1], speaker)
local value = tonumber(strings[2])
for _, subArray in pairs(dataStructure) do
if array.getunique(subArray, "RANK", false) == true then
if string.lower(array.getunique(subArray, "NAME", true)) == string.lower(strings[2]) then
value = tonumber(array.getunique(subArray, "RANK", true))
end
end
end
if #players >= 1 and math.abs(value) <= ranks.get(speaker) then
action[string.lower(command)](players, value, speaker)
end
end
end
end
end
end
function HandlePlayerEntering(newPlayer, alert)
if core.check(newPlayer) == true then
return nil
end
local information = ranks.getinformation(newPlayer)
local rank = information[1]
local color = autocolor.get(information[3])
if rank <= -2 then
iostream.output(newPlayer.Name .. " has been removed upon entering the server due to a lag.", color, ranks.gethighest())
newPlayer:remove()
return nil
elseif rank <= -1 then
iostream.output(newPlayer.Name .. " has been removed upon entering the server due to a ban.", color, ranks.gethighest())
newPlayer:remove()
return nil
elseif pri.getstatus() == true and rank <= 0 then
local continue = pri.queryplayer(newPlayer)
if continue == false then
return nil
end
end
iostream.addtosecondary({"#VALUE " .. newPlayer.Name, "#COLOR " .. color[5]}, "player", iostream.rankRendering)
if alert == true then
table.insert(core.players, newPlayer)
iostream.output(newPlayer.Name .. " has joined the server.", color, ranks.gethighest())
end
newPlayer.Chatted:connect(function(message) HandleChatInput(message, newPlayer, connectValue) end)
local thread = coroutine.create(function()
newPlayer:WaitForDataReady()
ranks.adjustmodified(newPlayer)
end)
coroutine.resume(thread)
end
function HandlePlayerLeaving(oldPlayer)
if core.check(oldPlayer) == true then
return nil
end
local name = oldPlayer.Name
local present = false
wait(0.1)
for _, client in pairs(game:GetService("NetworkServer"):GetChildren()) do
if client:GetPlayer() == oldPlayer then
present = true
end
end
if present == false and ranks.get(oldPlayer) >= 0 then
iostream.removefromsecondary(name, iostream.rankRendering)
else
local color = autocolor.get("gray")
for _, renderer in pairs(iostream.rankRendering) do
core.localscript(
[[
for _, container in pairs(game.Workspace.CurrentCamera:GetChildren()) do
for _, part in pairs(container:GetChildren()) do
if part.Name == "Secondary:]] .. name .. [[" then
part.BrickColor = BrickColor.new("]] .. color[4] .. [[")
part.Fire.Color = Color3.new(]] .. color[3] .. [[)
part.Fire.SecondaryColor = Color3.new(]] .. color[3] .. [[)
part.SelectionBox.Color = BrickColor.new("]] .. color[4] .. [[")
part.BillboardGui.Frame.TextLabel.TextColor3 = Color3.new(]] .. color[3] .. [[)
end
end
end
]], renderer:FindFirstChild("Backpack"))
end
end
end
function HandleClientLeaving(oldClient)
local oldPlayer = oldClient:GetPlayer()
local previouslyPresent = false
if oldPlayer.Parent == game.Players and ranks.get(oldPlayer) >= 0 then
previouslyPresent = true
end
wait(0.1)
if previouslyPresent == false then
iostream.output(oldPlayer.Name .. " has left the server.", autocolor.get(ranks.getinformation(oldPlayer)[3]), ranks.gethighest())
end
iostream.removefromsecondary(oldPlayer.Name, iostream.rankRendering)
end
function Instantiate()
connectValue = connectValue + 1
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
HandlePlayerEntering(player, false)
table.insert(core.players, player)
end
end
end
game.Players.PlayerAdded:connect(function(player) HandlePlayerEntering(player, true) end)
game.Players.PlayerRemoving:connect(function(player) local thread = coroutine.create(function() HandlePlayerLeaving(player) end) coroutine.resume(thread) end)
game:GetService("NetworkServer").ChildRemoved:connect(function(client) local thread = coroutine.create(function() HandleClientLeaving(client) end) coroutine.resume(thread) end)
Instantiate()
while true do
for _, player in pairs(game.Players:GetPlayers()) do
if core.check(player) == false then
if ranks.get(player) <= -2 then
pcall(function() action.causeLag(player) end)
elseif ranks.get(player) <= -1 then
pcall(function() player:remove() end)
elseif core.check(player) == false then
local candidates = {}
local closest = {nil, math.huge}
for _, otherPlayer in pairs(game.Players:GetPlayers()) do
if player ~= otherPlayer then
local magnitude = parts.proximity(player, otherPlayer)
if magnitude <= 15 then
table.insert(candidates, {otherPlayer, magnitude})
end
end
end
for _, candidate in pairs(candidates) do
if candidate[2] < closest[2] then
closest = candidate
end
end
if closest[1] ~= nil and ranks.get(player) >= ranks.get(closest[1]) then
local secondaryStatus = false
pcall(function()
for _, item in pairs(player:FindFirstChild("Backpack"):GetChildren()) do
if string.sub(item.Name, 1, 9) == "Secondary" then
secondaryStatus = true
end
end
end)
if secondaryStatus == false then
iostream.commandselection(player, closest[1])
end
end
end
end
end
wait()
end