Advertisement
2AreYouMental110

mentaladmin; prison life admin script (WIP)

Aug 3rd, 2022 (edited)
1,896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.91 KB | None | 0 0
  1. -- big credit to this video for most of the code shown
  2. -- https://www.youtube.com/watch?v=B87hxW_vMJI
  3.  
  4.  
  5.  
  6.  
  7.  
  8. -- maybe gonna work on this 2 - 10 days later
  9.  
  10.  
  11.  
  12. rconsoleprint[[
  13.  
  14. commands:
  15.  
  16. reset
  17. rj/rejoin
  18. neutral
  19. absoluteneutral
  20. guards/police/riot
  21. inmate/prisoner
  22. ws/walkspeed
  23. jp/jumppower
  24.  
  25. ]]
  26. local prefix = "mentaladmin;" -- cant change or else itwill break
  27. game.Players.LocalPlayer.Chatted:Connect(function(msg)
  28.     msg = msg:lower()
  29.     if string.sub(msg,1,12) == prefix then
  30.         local cmd
  31.         local space = string.find(msg," ")
  32.         if space then
  33.             cmd = string.sub(msg,13,space-1)
  34.         else
  35.             cmd = string.sub(msg,13)
  36.         end
  37.        
  38.  
  39.  
  40.  
  41.  
  42.  
  43.         if cmd == "reset" then
  44.             game.Players.LocalPlayer.Character:BreakJoints()
  45.         end
  46.  
  47.         if cmd == "rj" then
  48.             game:GetService("TeleportService"):Teleport(game.PlaceId, game:GetService("Players").LocalPlayer)
  49.         end
  50.  
  51.         if cmd == "rejoin" then
  52.             game:GetService("TeleportService"):Teleport(game.PlaceId, game:GetService("Players").LocalPlayer)
  53.         end
  54.  
  55.         if cmd == "absoluteneutral" then
  56.             game.Players.LocalPlayer.Neutral = true
  57.         end
  58.  
  59.         if cmd == "guard" then
  60.             local A_1 = "Bright blue"
  61.             local Event = game:GetService("Workspace").Remote.TeamEvent
  62.             Event:FireServer(A_1)
  63.         end
  64.  
  65.         if cmd == "police" then
  66.             local A_1 = "Bright blue"
  67.             local Event = game:GetService("Workspace").Remote.TeamEvent
  68.             Event:FireServer(A_1)
  69.         end
  70.  
  71.         if cmd == "guards" then
  72.             local A_1 = "Bright blue"
  73.             local Event = game:GetService("Workspace").Remote.TeamEvent
  74.             Event:FireServer(A_1)
  75.         end
  76.  
  77.         if cmd == "riot" then
  78.             local A_1 = "Bright blue"
  79.             local Event = game:GetService("Workspace").Remote.TeamEvent
  80.             Event:FireServer(A_1)
  81.         end
  82.  
  83.         if cmd == "neutral" then
  84.             local A_1 = "Medium stone grey"
  85.             local Event = game:GetService("Workspace").Remote.TeamEvent
  86.             Event:FireServer(A_1)
  87.         end
  88.  
  89.         if cmd == "prisoners" then
  90.             local A_1 = "Bright orange"
  91.             local Event = game:GetService("Workspace").Remote.TeamEvent
  92.             Event:FireServer(A_1)
  93.         end
  94.  
  95.         if cmd == "prisoner" then
  96.             local A_1 = "Bright orange"
  97.             local Event = game:GetService("Workspace").Remote.TeamEvent
  98.             Event:FireServer(A_1)
  99.         end
  100.  
  101.         if cmd == "inmate" then
  102.             local A_1 = "Bright orange"
  103.             local Event = game:GetService("Workspace").Remote.TeamEvent
  104.             Event:FireServer(A_1)
  105.         end
  106.  
  107.         if cmd == "ws" then
  108.             game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = string.sub(msg,16,100)
  109.             print(string.sub(msg,16,300))
  110.         end
  111.  
  112.         if cmd == "walkspeed" then
  113.             game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = string.sub(msg,23,100)
  114.             print(string.sub(msg,23,300))
  115.         end
  116.  
  117.         if cmd == "jp" then
  118.             game.Players.LocalPlayer.Character.Humanoid.JumpPower = string.sub(msg,16,100)
  119.             print(string.sub(msg,16,300))
  120.         end
  121.  
  122.         if cmd == "jumppower" then
  123.             game.Players.LocalPlayer.Character.Humanoid.JumpPower = string.sub(msg,23,300)
  124.             print(string.sub(msg,23,300))
  125.         end
  126.        
  127.  
  128.  
  129.  
  130.  
  131.     end
  132. end)
  133.  
  134. function GetPlayer(String)
  135.     local plr = {}
  136.     local strl = String:lower()
  137.         for i, v in pairs(game:GetService("Players"):GetPlayers()) do
  138.             if v.Name:lower():sub(1, #String) == String:lower() then
  139.                 table.insert(plr, v)
  140.             end
  141.         end
  142.         if String == "me" then
  143.             table.clear(plr)
  144.             table.insert(plr, game.Players.LocalPlayer)
  145.         end
  146.  
  147.         if String == "all" then
  148.             for i,v in pairs(game.Players:GetPlayers()) do
  149.                 if v.Name ~= game.Players.LocalPlayer.Name then
  150.                     table.insert(plr, v)
  151.                 end
  152.             end
  153.         end
  154.  
  155.     return plr
  156. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement