Advertisement
Guest User

mod menu

a guest
Feb 27th, 2019
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     WARNING!
  3.     This script can lead to a ban if used on more strict games (Phantom Forces, FPS shooters)
  4.     We are not responsible for any consequences on thou.
  5.    
  6.     For the fact of this, this script has been dubbed: "Uncertainary"
  7.    
  8.     To toggle this script, press the LeftShift key, then the Insert key.
  9. --]]
  10.  
  11. local PlayerService = game:GetService('Players');
  12. local player = PlayerService.LocalPlayer;
  13. local cam = workspace.CurrentCamera;
  14. local Camera = {};
  15. local TrackHumanoid = false; -- If set to false, then this will only track players, else we will track NPCs and players.
  16. local enabled = false;
  17. local sleight = false;
  18. local UserInput = game:GetService('UserInputService');
  19.  
  20. if not gui then
  21.     gui = Instance.new('BillboardGui');
  22.     local frame = Instance.new('Frame', gui);
  23.    
  24.     gui.AlwaysOnTop = true;
  25.     gui.LightInfluence = 0;
  26.     gui.Size = UDim2.new(0, 100, 0, 100);
  27.     frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  28.     frame.BackgroundTransparency = .75;
  29.     frame.Size = UDim2.new(1, 0, 1, 0);
  30.     frame.Rotation = 45;
  31.     frame.BorderSizePixel = 0;
  32. end;
  33.  
  34. function Camera:LockPlayer(p, isNPC)
  35.     if isNPC == true then
  36.         if p and p.Parent:IsA('Model') and p.Parent:FindFirstChild('Torso') then
  37.             local t = p.Parent.Torso.CFrame * Vector3.new(0, -0.25, 0);
  38.             cam.CFrame = CFrame.new(cam.Focus.p, t) * CFrame.new(0, 0, 0.5);
  39.             gui.Parent = p.Parent.Torso;
  40.         end;
  41.     else
  42.         if p and p.Character and p.Character:FindFirstChild('Torso') then
  43.             local t = p.Character.Torso.CFrame * Vector3.new(0, -0.25, 0);
  44.             cam.CFrame = CFrame.new(cam.Focus.p, t) * CFrame.new(0, 0, 0.5);
  45.             gui.Parent = p.Character.Torso;
  46.         end;
  47.     end;
  48. end;
  49.  
  50.  
  51. game:GetService("RunService").RenderStepped:connect(function()
  52. if enabled == true then
  53.     for _,v in pairs(PlayerService:GetChildren()) do
  54.         if v:IsA('Player') and v.Character then
  55.             if v.Character:FindFirstChildOfClass('Humanoid') and v.Character:FindFirstChildOfClass('Humanoid').Health > 0 then
  56.                 if v == player then
  57.                 else
  58.                     Camera:LockPlayer(v);
  59.                 end;
  60.             end;
  61.         end;
  62.     end;
  63.    
  64.     if TrackHumanoid==true then for _,v in pairs(workspace:GetDescendants()) do
  65.         if v.Parent:IsA('Model') and v.Parent:FindFirstChildOfClass('Humanoid') and v.Parent:FindFirstChildOfClass('Humanoid').Health > 0 then
  66.             if v.Parent.Name == player.Name then
  67.             else
  68.                 Camera:LockPlayer(v, true);
  69.             end;
  70.         end;
  71.     end;
  72.     end;
  73. elseif enabled == false then
  74.     if gui then
  75.         gui.Parent = nil;
  76.     end;
  77. end;
  78. end);
  79.  
  80. UserInput.InputBegan:connect(function(input)
  81.     if input.KeyCode == Enum.KeyCode.LeftShift then
  82.         sleight = not sleight;
  83.     end;
  84. end);
  85.  
  86. UserInput.InputEnded:connect(function(input)
  87.     if input.KeyCode == Enum.KeyCode.Insert and sleight == true then
  88.         enabled = not enabled;
  89.     end;
  90. end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement