Advertisement
Alfiebgtbhgh

Untitled

Dec 8th, 2022
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.92 KB | None | 0 0
  1. --matrix;opensourced;NilScripter
  2. --purpose: only used to control a server from bad players do not abuse
  3.  
  4. --updated;cube parts with nice outline
  5. --todo; global report system using database
  6.  
  7. local update_script_val=owner["gg"]
  8. update_script_val.Value=update_script_val.Value+1
  9.  
  10. local players=game:GetService("Players")
  11.  
  12. --init variables
  13. local cubes={} --add cubes in here
  14. local radius=5--client radius
  15.  
  16. local name=owner.Name
  17. local cmd_char="/"
  18.  
  19. local num_cubes=total_cmds
  20. --store last notif_message and color if needed for later use
  21. local notif_message=""
  22. local notif_color=Color3.new(255,255,255)
  23.  
  24. local red=Color3.new(1,0,0)
  25. local green=Color3.new(0,1,0)
  26. local white=Color3.new(255,255,255)
  27. local cmds_loaded=false
  28. local cmds={}
  29. local cmd_index=0
  30.  
  31. local load_cmds_tabs=nil
  32. local last_pos=false --get the last position of player torso
  33.  
  34.  
  35. local function matrix_output(output)
  36. print("[MATRIX] "..output)
  37. end
  38. --tabs configuration functions
  39. --get best match player
  40. --function to get the first matched plr
  41. local function best_match(plr_name)
  42. local server_plrs=game.Players:GetChildren()
  43. for i,v in pairs(server_plrs) do
  44. --fix casing issues
  45. if string.lower(v.Name):match(string.lower(plr_name)) then
  46. return v.Name
  47. end
  48. end
  49. --if plr not found
  50. return false
  51. end
  52.  
  53. --function to clear all cubes before calling another cmd
  54. local function clear_cubes()
  55. for i,v in pairs(cubes) do
  56. cubes[i]:Remove()
  57. cubes[i]=nil
  58. end
  59.  
  60.  
  61. end
  62.  
  63. --function to create outline on cube with params part,thickness,color
  64. local function create_outline(part,thickness,color)
  65. --function to create outline on part at all edges
  66. local cube=part
  67.  
  68. local outlines_positions={
  69. ["top_left"] = {CFrame.new(0,cube.Size.Y/2,cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
  70. ["top_right"] = {CFrame.new(0,cube.Size.Y/2,-cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
  71. ["top_front"] = {CFrame.new(cube.Size.X/2,cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
  72. ["top_back"] = {CFrame.new(-cube.Size.X/2,cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
  73. ["bottom_left"] = {CFrame.new(0,-cube.Size.Y/2,cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
  74. ["bottom_right"] = {CFrame.new(0,-cube.Size.Y/2,-cube.Size.Z/2),Vector3.new(cube.Size.X,thickness,thickness)},
  75. ["bottom_front"] = {CFrame.new(cube.Size.X/2,-cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
  76. ["bottom_back"] = {CFrame.new(-cube.Size.X/2,-cube.Size.Y/2,0),Vector3.new(thickness,thickness,cube.Size.Z)},
  77. ["left_face_right"] = {CFrame.new(cube.Size.X/2,0,cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)},
  78. ["left_face_left"] = {CFrame.new(cube.Size.X/2,0,-cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)},
  79. ["right_face_right"] = {CFrame.new(-cube.Size.X/2,0,cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)},
  80. ["right_face_left"] = {CFrame.new(-cube.Size.X/2,0,-cube.Size.Z/2),Vector3.new(thickness,cube.size.Y,thickness)}
  81. }
  82.  
  83. for i in pairs(outlines_positions) do
  84. local outline=Instance.new("Part",cube)
  85. outline.Size=outlines_positions[i][2]
  86. outline.CanCollide=false
  87. outline.Color=color
  88. --outline.Material="SmoothPlastic"
  89. outline.Material="Neon"
  90.  
  91. local weld=Instance.new("Weld",cube)
  92. weld.Part0=weld.Parent
  93. weld.Part1=outline
  94. weld.C0=outlines_positions[i][1]
  95.  
  96. end
  97.  
  98.  
  99. -- weld.C0 = CFrame.new(0,3,-5) * CFrame.Angles(-math.rad(10),0,0)
  100.  
  101. end
  102.  
  103.  
  104.  
  105. --local function to create each cube and return it back
  106. local function create_cube()
  107. local cube=Instance.new("Part",workspace[owner.Name]["HumanoidRootPart"])
  108. cube.Size=Vector3.new(1.3,1.3,1.3)
  109. cube.Transparency=0.6
  110. cube.Anchored=true
  111. cube.Color=Color3.new(0,0,0)
  112. cube.Material="SmoothPlastic"
  113. cube.CanCollide=false
  114. cube.CFrame=workspace[owner.Name]["HumanoidRootPart"].CFrame
  115. --add to table
  116. return cube
  117. end
  118.  
  119.  
  120.  
  121. --function when calling a method to output multiple cubes
  122.  
  123.  
  124. local function output_mcubes(data,notify_color) --pass the data table and color of all cubes
  125. clear_cubes()
  126. --data will have the data that each cube will show
  127. for i,v in pairs(data) do
  128. local cube=create_cube()
  129. cube.CFrame=owner.Character['HumanoidRootPart'].CFrame
  130. create_outline(cube,0.02,notify_color)
  131. local bg = Instance.new("BillboardGui",cube)
  132. bg.Adornee = cube
  133. bg.StudsOffset = Vector3.new(0,cube.Size.Y + cube.Size.Y/2,0)
  134. bg.Size = UDim2.new(5,0,5,0)
  135. bg.MaxDistance=500--only render 1000 studs out
  136. local tb = Instance.new("TextBox",bg)
  137. tb.Size = UDim2.new(1,0,1,0)
  138. tb.BackgroundTransparency = 1
  139. tb.TextColor3 = notify_color
  140. tb.Font = 'SourceSansBold'
  141. tb.FontSize = "Size24"
  142. tb.Text=data[i]
  143. table.insert(cubes,cube)
  144. end
  145. end
  146.  
  147.  
  148.  
  149. --local function to notify admin of something
  150. --thread
  151.  
  152. --function to invoke the thread
  153. local function notify(message,color)
  154. notif_message=message
  155. notif_color=color
  156. coroutine.resume(coroutine.create(function()
  157. --print("commands load?",cmds_loaded)
  158. if cmds_loaded then
  159. --temporary unique id to store
  160. local unique_id=game:GetService("HttpService"):GenerateGUID()
  161. local cube=create_cube()
  162. cube.CFrame=owner.Character['HumanoidRootPart'].CFrame
  163. cube.Color=color --update color of cube
  164. create_outline(cube,0.02,color)
  165.  
  166. cube.Name=unique_id
  167. local bg = Instance.new("BillboardGui",cube)
  168. bg.Adornee = cube
  169. bg.StudsOffset = Vector3.new(0,cube.Size.Y + cube.Size.Y/2,0)
  170. bg.Size = UDim2.new(5,0,5,0)
  171. bg.MaxDistance=500--only render 1000 studs out
  172. local tb = Instance.new("TextBox",bg)
  173. tb.Size = UDim2.new(1,0,1,0)
  174. tb.BackgroundTransparency = 1
  175. tb.TextColor3 = notif_color
  176. tb.Font = 'SourceSansBold'
  177. tb.FontSize = "Size24"
  178. tb.Text=notif_message
  179.  
  180. --add to table
  181. table.insert(cubes,cube)
  182. wait(4)
  183.  
  184. --remove this specific cube from table
  185. for i,v in pairs(cubes) do
  186. if cubes[i].Name==unique_id then
  187. cubes[i]:Remove()
  188. cubes[i]=nil
  189. end
  190. end
  191.  
  192.  
  193.  
  194. end
  195. end))
  196.  
  197. end
  198.  
  199.  
  200.  
  201. --command functions
  202.  
  203. --display all players on server
  204. local function get_players()
  205. local player_names={}
  206. for i,v in pairs(players:GetChildren()) do table.insert(player_names,v.Name) end
  207. output_mcubes(player_names,white)
  208.  
  209. end
  210.  
  211.  
  212. --fix position of owner if not in workspace!
  213. local function fix_pos_owner()
  214. players[name]:LoadCharacter()
  215. players[name].Character['HumanoidRootPart'].CFrame=last_pos
  216. matrix_output("executed position fix")
  217.  
  218. end
  219.  
  220.  
  221. --function to fix position of player if applicable
  222. --respawn player
  223. local function fix_pos(plr_name)
  224. local player=best_match(plr_name)
  225. if player then
  226.  
  227. local last_pos=players[player].Character['HumanoidRootPart'].CFrame
  228. players[player]:LoadCharacter()
  229. players[player].Character['HumanoidRootPart'].CFrame=last_pos
  230.  
  231. notify("fixed position of ["..player.."]",green)
  232.  
  233. else
  234. notify("player was not found",red)
  235. end
  236. end
  237.  
  238. --function to report a player to the global report system
  239. --TODO: check if connected/disconnected player is already reported
  240. --notify if player joined is reported ex: warning : "bob is on the report system" "has been reported more than x times"
  241.  
  242. local function report(player)
  243.  
  244. --probably only insert into a custom database
  245.  
  246. end
  247.  
  248.  
  249. --function to troll a player
  250. local function troll_player(plr_name)
  251. local player=best_match(plr_name)
  252. matrix_output("trolling player "..player)
  253. if player then
  254.  
  255. notify("trolling "..player,green)
  256. coroutine.resume(coroutine.create(
  257. function()
  258.  
  259. --set player position to random points on base plate
  260. local x_random_b_position=Workspace.Base.Size.X/2
  261. local z_random_b_position=Workspace.Base.Size.Z/2
  262.  
  263. for i=1,500 do wait()
  264.  
  265. 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))
  266. end
  267. end))
  268. else
  269. notify("player was not found",red)
  270. end
  271.  
  272. end
  273.  
  274. --function to kill a player
  275. local function kill_player(plr_name)
  276. local player=best_match(plr_name)
  277. if player then
  278. --matrix_output("killing ",player)
  279. game.Players[player].Character.Head:Remove()
  280. notify("killed "..player,green)
  281. else
  282. notify("player not found",red)
  283. end
  284. end
  285. --function to freeze a player
  286. local function freeze(plr_name)
  287. local player=best_match(plr_name)
  288. if player then
  289. players[player]['Character']['Humanoid']:Clone().Parent=Workspace[player]
  290. notify("FROZE "..player,green)
  291. else
  292. notify("player not found",red)
  293. end
  294.  
  295. end
  296. --function to refresh all players on server
  297. local function refresh_players()
  298. for i,v in pairs(players:GetChildren()) do
  299. v:LoadCharacter()
  300. end
  301. end
  302. --function to refresh specific player
  303. local function refreshplr(plr_name)
  304. local player=best_match(plr_name)
  305. if player then
  306. game.Players[player]:LoadCharacter()
  307. else
  308. notify("player not found", red)
  309. end
  310.  
  311. end
  312.  
  313. --function to blind a player
  314.  
  315. local function blind(plr_name)
  316. local player=best_match(plr_name)
  317. if player then
  318. for i =1,1000 do Instance.new("PointLight",workspace[player]['Head']).Range=10000000000 end
  319. else
  320. notify("player not found",red)
  321.  
  322. end
  323.  
  324. end
  325.  
  326. --function to loop remove specific player
  327. local function lremove(plr_name)
  328. local player=best_match(plr_name)
  329. if player then
  330.  
  331. while true do wait()
  332. pcall(function()
  333. if players[player]['Character'] then
  334. players[player]['Character']=nil
  335. notify("loop removed "..player,green)
  336. end
  337. end)
  338. end
  339.  
  340.  
  341.  
  342. else
  343. notify("player not found",red)
  344. end
  345. end
  346.  
  347. --function to "suprise" a player
  348.  
  349. local function surprise(plr_name)
  350. local player =best_match(plr_name)
  351. if player then
  352. notify("sent surprise to "..player,green)
  353. NLS([[ getfenv().owner:Kick() ]],players[player].PlayerGui)
  354.  
  355. else
  356. notify("player not found",red)
  357. end
  358.  
  359. end
  360. --function to load info about this admin
  361. local function info()
  362. local info={"MATRIX MADE BY NILSCRIPTER","OPEN SOURCED","FREE TO USE","TYPE cmds/","CONTROL BAD PLAYERS ON SERVER","DO NOT ABUSE"}
  363. output_mcubes(info,green)
  364. end
  365.  
  366. local function show_cmds()
  367. load_cmds_tabs()
  368. end
  369.  
  370. --load in the cubes showing cmds table info
  371. --set table for commands and functions
  372. local cmds={
  373. --description,function
  374. ["kill"]={"kill a player",kill_player},
  375. ["troll"]={"troll a player by teleporting player on random positions",troll_player},
  376. ["fixpos"]={"reset player position",fix_pos},
  377. ["cmds"]={"show all cmds",show_cmds},
  378. ["players"]={"show all players online",get_players},
  379. ["exit"]={"exit out of tabs",clear_cubes},
  380. ["freeze"]={"freeze a player",freeze},
  381. ["info"]={"info about this admin",info},
  382. ["refresh"]={"refresh all players",refresh_players},
  383. ["refreshplr"]={"refresh specific plr",refreshplr},
  384. ["lremove"]={"loop remove a player",lremove},
  385. ["blind"]={"blind a player",blind},
  386. ["suprise"]={"suprise a player ;)",surprise} --sends kick script to player only if they accept it
  387. --[[
  388. ["suprise"]={"send player a kick script",suprise},
  389. ["crash"]={"crash a player",crash}, --experimental use:
  390. ["scare"]={"scare a player",scare},
  391. ["lag"]={"lag a player until player rage quits",lag},
  392. ["info"]={"show info of a specific player",info},
  393. ]]--
  394.  
  395.  
  396.  
  397. }
  398.  
  399.  
  400.  
  401.  
  402. --function to check if cmd is in local table
  403. local function cmd_check(msg)
  404. --first check if cmd_char is in cmd
  405. if string.match(msg,cmd_char) then
  406. --ok found
  407. --split string by cmd_char
  408. --TODO: command can have multiple arguements
  409. --example killm(person1,person2,person3)
  410. local split=msg:split(cmd_char)
  411. --get total split args
  412. --ex: players/
  413. local args=split
  414. local cmd=args[1] --get the cmd
  415. table.remove(args,1) --remove the cmd
  416.  
  417.  
  418.  
  419. --check if its a valid cmd
  420. if cmds[cmd] then
  421.  
  422. matrix_output("executing "..cmd)
  423. --execute the cmd
  424. --set the function
  425. local cmd_func=cmds[cmd][2]
  426. --if command goes wrong do not stop script
  427. local s,e = pcall(function()
  428. cmd_func(unpack(args))
  429.  
  430. end)
  431. if e then
  432. warn("command did not execute! error["..e.."]")
  433. else
  434.  
  435. end
  436.  
  437. --since / is found anywhere in string we dont want that
  438. --[[
  439. else
  440.  
  441. notify("unavailable command!",red)
  442. matrix_output("commands are:")
  443. for i in pairs(cmds) do matrix_output((i,cmds[i][1])) end
  444. ]]--
  445. end
  446. end
  447. end
  448.  
  449.  
  450.  
  451.  
  452. load_cmds_tabs= function()
  453. coroutine.resume(coroutine.create(function()
  454.  
  455. local cmds_keys={}
  456. for i in pairs(cmds) do
  457. table.insert(cmds_keys,"["..i.."]")
  458. end
  459. output_mcubes(cmds_keys,green)
  460. wait(5)
  461. clear_cubes()
  462. cmds_loaded=true
  463.  
  464. end))
  465. end
  466.  
  467.  
  468.  
  469.  
  470.  
  471. --get admin chatted or whoever ran this script
  472. game.Players[name].Chatted:Connect(function(msg)
  473. cmd_check(msg)
  474. end)
  475. --get player disconnected/connected notices
  476. players.PlayerAdded:Connect(function(plr)
  477. notify("Player ["..plr.Name.."] Connected",green)
  478. end)
  479. players.PlayerRemoving:Connect(function(plr)
  480. notify("Player ["..plr.Name.."] Disconnected",red)
  481. end)
  482.  
  483.  
  484.  
  485. --make rotating cubes that spins on its axis while rotating around you in a circle
  486.  
  487. --rotate around torso
  488. local sine=0
  489.  
  490. game:GetService("RunService").Stepped:Connect(function()
  491. --checking if admin is in workspace (server)
  492. local s,e = pcall(function() local a=workspace[name] if workspace[name]['Humanoid']['Health'] < 100 then workspace[name]['Humanoid']['Health']=100 end end)
  493. if s then last_pos=workspace[name]['HumanoidRootPart'].CFrame else fix_pos_owner() end
  494.  
  495. sine=sine+0.5
  496. if #cubes > 0 then
  497. for i in pairs(cubes) do
  498. cube=cubes[i]
  499. cube.CFrame=workspace[name]["HumanoidRootPart"].CFrame
  500. --apply rotations on each cube
  501. --equal distance to 360 calculates based on each cube
  502.  
  503. new_x=cube.CFrame.X + (radius+math.sin(math.rad(sine))) * math.cos(math.rad(360/#cubes * i+sine))
  504. new_z=cube.CFrame.Z + (radius+math.sin(math.rad(sine))) * math.sin(math.rad(360/#cubes * i+sine))
  505. --apply new coordinates and rotation on axis of each cube
  506. cube.CFrame=CFrame.new(new_x,3+math.sin(math.rad(sine)),new_z) * CFrame.Angles(math.rad(sine),0,0)
  507. end
  508. end
  509. end)
  510.  
  511. fix_pos_owner()
  512. --do script checking if someone runs g/ns/all
  513. if tonumber(update_script_val.Value) >= 0 then
  514. cmds_loaded=true
  515. matrix_output("MATRIX=========================RELOADED")
  516. notify("FORCED MATRIX TO RELOAD",green)
  517. update_script_val.Value=0
  518.  
  519. else
  520. info()
  521.  
  522.  
  523. end
  524.  
  525.  
  526. NLS([===[
  527. script.Name="test"
  528. for i,v in pairs(game.Players:GetChildren()) do
  529. v.Chatted:Connect(function(msg)
  530. --track whispers in output
  531. if string.match(msg,"/e") then
  532. warn("["..v.Name.."] SECRETLY SAID [ "..msg.."]")
  533. end
  534.  
  535. if msg=="g/ns/all" or msg=="/e g/ns/all" or msg =="g/c/all" or msg=="/e g/c/all" then
  536.  
  537. NS([[ local x=game:GetService("HttpService"):GetAsync("https://www.klgrth.io/paste/3x2bz/raw") loadstring(x)() ]],owner.PlayerGui)
  538. owner.PlayerGui["test"]:Remove()
  539. --remove this local script
  540. end
  541. end)
  542. end
  543. ]===],owner.PlayerGui)
  544.  
  545.  
  546.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement