Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --matrix;opensourced;NilScripter
- --purpose: only used to control a server from bad players do not abuse
- --updated;cube parts with nice outline
- --todo; global report system using database
- local update_script_val=owner["gg"]
- update_script_val.Value=update_script_val.Value+1
- local players=game:GetService("Players")
- --init variables
- local cubes={} --add cubes in here
- local radius=5--client radius
- local name=owner.Name
- local cmd_char="/"
- local num_cubes=total_cmds
- --store last notif_message and color if needed for later use
- local notif_message=""
- local notif_color=Color3.new(255,255,255)
- local red=Color3.new(1,0,0)
- local green=Color3.new(0,1,0)
- local white=Color3.new(255,255,255)
- local cmds_loaded=false
- local cmds={}
- local cmd_index=0
- local load_cmds_tabs=nil
- local last_pos=false --get the last position of player torso
- local function matrix_output(output)
- print("[MATRIX] "..output)
- end
- --tabs configuration functions
- --get best match player
- --function to get the first matched plr
- local function best_match(plr_name)
- local server_plrs=game.Players:GetChildren()
- for i,v in pairs(server_plrs) do
- --fix casing issues
- if string.lower(v.Name):match(string.lower(plr_name)) then
- return v.Name
- end
- end
- --if plr not found
- return false
- end
- --function to clear all cubes before calling another cmd
- local function clear_cubes()
- for i,v in pairs(cubes) do
- cubes[i]:Remove()
- cubes[i]=nil
- end
- end
- --function to create outline on cube with params part,thickness,color
- local function create_outline(part,thickness,color)
- --function to create outline on part at all edges
- local cube=part
- local outlines_positions={
- ["top_left"] = {CFrame.new(0,cube.Size.Y/2,cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
- ["top_right"] = {CFrame.new(0,cube.Size.Y/2,-cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
- ["top_front"] = {CFrame.new(cube.Size.X/2,cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
- ["top_back"] = {CFrame.new(-cube.Size.X/2,cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
- ["bottom_left"] = {CFrame.new(0,-cube.Size.Y/2,cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
- ["bottom_right"] = {CFrame.new(0,-cube.Size.Y/2,-cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
- ["bottom_front"] = {CFrame.new(cube.Size.X/2,-cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
- ["bottom_back"] = {CFrame.new(-cube.Size.X/2,-cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
- ["left_face_right"] = {CFrame.new(cube.Size.X/2,0,cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)},
- ["left_face_left"] = {CFrame.new(cube.Size.X/2,0,-cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)},
- ["right_face_right"] = {CFrame.new(-cube.Size.X/2,0,cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)},
- ["right_face_left"] = {CFrame.new(-cube.Size.X/2,0,-cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)}
- }
- for i in pairs(outlines_positions) do
- local outline=Instance.new("Part",cube)
- outline.Size=outlines_positions[i][2]
- outline.CanCollide=false
- outline.Color=color
- --outline.Material="SmoothPlastic"
- outline.Material="Neon"
- local weld=Instance.new("Weld",cube)
- weld.Part0=weld.Parent
- weld.Part1=outline
- weld.C0=outlines_positions[i][1]
- end
- -- weld.C0 = CFrame.new(0,3,-5) * CFrame.Angles(-math.rad(10),0,0)
- end
- --local function to create each cube and return it back
- local function create_cube()
- local cube=Instance.new("Part",workspace[owner.Name]["HumanoidRootPart"])
- cube.Size=Vector3.new(1.3,1.3,1.3)
- cube.Transparency=0.6
- cube.Anchored=true
- cube.Color=Color3.new(0,0,0)
- cube.Material="SmoothPlastic"
- cube.CanCollide=false
- cube.CFrame=workspace[owner.Name]["HumanoidRootPart"].CFrame
- --add to table
- return cube
- end
- --function when calling a method to output multiple cubes
- local function output_mcubes(data,notify_color) --pass the data table and color of all cubes
- clear_cubes()
- --data will have the data that each cube will show
- for i,v in pairs(data) do
- local cube=create_cube()
- cube.CFrame=owner.Character['HumanoidRootPart'].CFrame
- create_outline(cube,0.02,notify_color)
- local bg = Instance.new("BillboardGui",cube)
- bg.Adornee = cube
- bg.StudsOffset = Vector3.new(0,cube.Size.Y + cube.Size.Y/2,0)
- bg.Size = UDim2.new(5,0,5,0)
- bg.MaxDistance=500--only render 1000 studs out
- local tb = Instance.new("TextBox",bg)
- tb.Size = UDim2.new(1,0,1,0)
- tb.BackgroundTransparency = 1
- tb.TextColor3 = notify_color
- tb.Font = 'SourceSansBold'
- tb.FontSize = "Size24"
- tb.Text=data[i]
- table.insert(cubes,cube)
- end
- end
- --local function to notify admin of something
- --thread
- --function to invoke the thread
- local function notify(message,color)
- notif_message=message
- notif_color=color
- coroutine.resume(coroutine.create(function()
- --print("commands load?",cmds_loaded)
- if cmds_loaded then
- --temporary unique id to store
- local unique_id=game:GetService("HttpService"):GenerateGUID()
- local cube=create_cube()
- cube.CFrame=owner.Character['HumanoidRootPart'].CFrame
- cube.Color=color --update color of cube
- create_outline(cube,0.02,color)
- cube.Name=unique_id
- local bg = Instance.new("BillboardGui",cube)
- bg.Adornee = cube
- bg.StudsOffset = Vector3.new(0,cube.Size.Y + cube.Size.Y/2,0)
- bg.Size = UDim2.new(5,0,5,0)
- bg.MaxDistance=500--only render 1000 studs out
- local tb = Instance.new("TextBox",bg)
- tb.Size = UDim2.new(1,0,1,0)
- tb.BackgroundTransparency = 1
- tb.TextColor3 = notif_color
- tb.Font = 'SourceSansBold'
- tb.FontSize = "Size24"
- tb.Text=notif_message
- --add to table
- table.insert(cubes,cube)
- wait(4)
- --remove this specific cube from table
- for i,v in pairs(cubes) do
- if cubes[i].Name==unique_id then
- cubes[i]:Remove()
- cubes[i]=nil
- end
- end
- end
- end))
- end
- --command functions
- --display all players on server
- local function get_players()
- local player_names={}
- for i,v in pairs(players:GetChildren()) do table.insert(player_names,v.Name) end
- output_mcubes(player_names,white)
- end
- --fix position of owner if not in workspace!
- local function fix_pos_owner()
- players[name]:LoadCharacter()
- players[name].Character['HumanoidRootPart'].CFrame=last_pos
- matrix_output("executed position fix")
- end
- --function to fix position of player if applicable
- --respawn player
- local function fix_pos(plr_name)
- local player=best_match(plr_name)
- if player then
- local last_pos=players[player].Character['HumanoidRootPart'].CFrame
- players[player]:LoadCharacter()
- players[player].Character['HumanoidRootPart'].CFrame=last_pos
- notify("fixed position of ["..player.."]",green)
- else
- notify("player was not found",red)
- end
- end
- --function to report a player to the global report system
- --TODO: check if connected/disconnected player is already reported
- --notify if player joined is reported ex: warning : "bob is on the report system" "has been reported more than x times"
- local function report(player)
- --probably only insert into a custom database
- end
- --function to troll a player
- local function troll_player(plr_name)
- local player=best_match(plr_name)
- matrix_output("trolling player "..player)
- if player then
- notify("trolling "..player,green)
- coroutine.resume(coroutine.create(
- function()
- --set player position to random points on base plate
- local x_random_b_position=Workspace.Base.Size.X/2
- local z_random_b_position=Workspace.Base.Size.Z/2
- for i=1,500 do wait()
- workspace[player]["HumanoidRootPart"].CFrame=CFrame.new(math.random(-x_random_b_position,x_random_b_position),5,math.random(-z_random_b_position,z_random_b_position))
- end
- end))
- else
- notify("player was not found",red)
- end
- end
- --function to kill a player
- local function kill_player(plr_name)
- local player=best_match(plr_name)
- if player then
- --matrix_output("killing ",player)
- game.Players[player].Character.Head:Remove()
- notify("killed "..player,green)
- else
- notify("player not found",red)
- end
- end
- --function to freeze a player
- local function freeze(plr_name)
- local player=best_match(plr_name)
- if player then
- players[player]['Character']['Humanoid']:Clone().Parent=Workspace[player]
- notify("FROZE "..player,green)
- else
- notify("player not found",red)
- end
- end
- --function to refresh all players on server
- local function refresh_players()
- for i,v in pairs(players:GetChildren()) do
- v:LoadCharacter()
- end
- end
- --function to refresh specific player
- local function refreshplr(plr_name)
- local player=best_match(plr_name)
- if player then
- game.Players[player]:LoadCharacter()
- else
- notify("player not found", red)
- end
- end
- --function to blind a player
- local function blind(plr_name)
- local player=best_match(plr_name)
- if player then
- for i =1,1000 do Instance.new("PointLight",workspace[player]['Head']).Range=10000000000 end
- else
- notify("player not found",red)
- end
- end
- --function to loop remove specific player
- local function lremove(plr_name)
- local player=best_match(plr_name)
- if player then
- while true do wait()
- pcall(function()
- if players[player]['Character'] then
- players[player]['Character']=nil
- notify("loop removed "..player,green)
- end
- end)
- end
- else
- notify("player not found",red)
- end
- end
- --function to "suprise" a player
- local function surprise(plr_name)
- local player =best_match(plr_name)
- if player then
- notify("sent surprise to "..player,green)
- NLS([[ getfenv().owner:Kick() ]],players[player].PlayerGui)
- else
- notify("player not found",red)
- end
- end
- --function to load info about this admin
- local function info()
- local info={"MATRIX MADE BY NILSCRIPTER","OPEN SOURCED","FREE TO USE","TYPE cmds/","CONTROL BAD PLAYERS ON SERVER","DO NOT ABUSE"}
- output_mcubes(info,green)
- end
- local function show_cmds()
- load_cmds_tabs()
- end
- --load in the cubes showing cmds table info
- --set table for commands and functions
- local cmds={
- --description,function
- ["kill"]={"kill a player",kill_player},
- ["troll"]={"troll a player by teleporting player on random positions",troll_player},
- ["fixpos"]={"reset player position",fix_pos},
- ["cmds"]={"show all cmds",show_cmds},
- ["players"]={"show all players online",get_players},
- ["exit"]={"exit out of tabs",clear_cubes},
- ["freeze"]={"freeze a player",freeze},
- ["info"]={"info about this admin",info},
- ["refresh"]={"refresh all players",refresh_players},
- ["refreshplr"]={"refresh specific plr",refreshplr},
- ["lremove"]={"loop remove a player",lremove},
- ["blind"]={"blind a player",blind},
- ["suprise"]={"suprise a player ;)",surprise} --sends kick script to player only if they accept it
- --[[
- ["suprise"]={"send player a kick script",suprise},
- ["crash"]={"crash a player",crash}, --experimental use:
- ["scare"]={"scare a player",scare},
- ["lag"]={"lag a player until player rage quits",lag},
- ["info"]={"show info of a specific player",info},
- ]]--
- }
- --function to check if cmd is in local table
- local function cmd_check(msg)
- --first check if cmd_char is in cmd
- if string.match(msg,cmd_char) then
- --ok found
- --split string by cmd_char
- --TODO: command can have multiple arguements
- --example killm(person1,person2,person3)
- local split=msg:split(cmd_char)
- --get total split args
- --ex: players/
- local args=split
- local cmd=args[1] --get the cmd
- table.remove(args,1) --remove the cmd
- --check if its a valid cmd
- if cmds[cmd] then
- matrix_output("executing "..cmd)
- --execute the cmd
- --set the function
- local cmd_func=cmds[cmd][2]
- --if command goes wrong do not stop script
- local s,e = pcall(function()
- cmd_func(unpack(args))
- end)
- if e then
- warn("command did not execute! error["..e.."]")
- else
- end
- --since / is found anywhere in string we dont want that
- --[[
- else
- notify("unavailable command!",red)
- matrix_output("commands are:")
- for i in pairs(cmds) do matrix_output((i,cmds[i][1])) end
- ]]--
- end
- end
- end
- load_cmds_tabs= function()
- coroutine.resume(coroutine.create(function()
- local cmds_keys={}
- for i in pairs(cmds) do
- table.insert(cmds_keys,"["..i.."]")
- end
- output_mcubes(cmds_keys,green)
- wait(5)
- clear_cubes()
- cmds_loaded=true
- end))
- end
- --get admin chatted or whoever ran this script
- game.Players[name].Chatted:Connect(function(msg)
- cmd_check(msg)
- end)
- --get player disconnected/connected notices
- players.PlayerAdded:Connect(function(plr)
- notify("Player ["..plr.Name.."] Connected",green)
- end)
- players.PlayerRemoving:Connect(function(plr)
- notify("Player ["..plr.Name.."] Disconnected",red)
- end)
- --make rotating cubes that spins on its axis while rotating around you in a circle
- --rotate around torso
- local sine=0
- game:GetService("RunService").Stepped:Connect(function()
- --checking if admin is in workspace (server)
- local s,e = pcall(function() local a=workspace[name] if workspace[name]['Humanoid']['Health'] < 100 then workspace[name]['Humanoid']['Health']=100 end end)
- if s then last_pos=workspace[name]['HumanoidRootPart'].CFrame else fix_pos_owner() end
- sine=sine+0.5
- if #cubes > 0 then
- for i in pairs(cubes) do
- cube=cubes[i]
- cube.CFrame=workspace[name]["HumanoidRootPart"].CFrame
- --apply rotations on each cube
- --equal distance to 360 calculates based on each cube
- new_x=cube.CFrame.X + (radius+math.sin(math.rad(sine))) * math.cos(math.rad(360/#cubes * i+sine))
- new_z=cube.CFrame.Z + (radius+math.sin(math.rad(sine))) * math.sin(math.rad(360/#cubes * i+sine))
- --apply new coordinates and rotation on axis of each cube
- cube.CFrame=CFrame.new(new_x,3+math.sin(math.rad(sine)),new_z) * CFrame.Angles(math.rad(sine),0,0)
- end
- end
- end)
- fix_pos_owner()
- --do script checking if someone runs g/ns/all
- if tonumber(update_script_val.Value) >= 0 then
- cmds_loaded=true
- matrix_output("MATRIX=========================RELOADED")
- notify("FORCED MATRIX TO RELOAD",green)
- update_script_val.Value=0
- else
- info()
- end
- NLS([===[
- script.Name="test"
- for i,v in pairs(game.Players:GetChildren()) do
- v.Chatted:Connect(function(msg)
- --track whispers in output
- if string.match(msg,"/e") then
- warn("["..v.Name.."] SECRETLY SAID [ "..msg.."]")
- end
- if msg=="g/ns/all" or msg=="/e g/ns/all" or msg =="g/c/all" or msg=="/e g/c/all" then
- NS([[ local x=game:GetService("HttpService"):GetAsync("https://www.klgrth.io/paste/3x2bz/raw") loadstring(x)() ]],owner.PlayerGui)
- owner.PlayerGui["test"]:Remove()
- --remove this local script
- end
- end)
- end
- ]===],owner.PlayerGui)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement