hellom38

Bullet script

Aug 16th, 2022 (edited)
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.68 KB | None | 0 0
  1. --BULLET HIT
  2.  
  3. local function Hit (cast,result,veloc,bullet)
  4.    
  5.         local hit =  result.Instance
  6.         if hit  then
  7.                 local hitpos =  result.Position
  8.               local findmodel =  hit:FindFirstAncestorOfClass("Model")
  9.               if findmodel  then
  10.                         local hum =  findmodel:FindFirstChild("Humanoid")
  11.                         if hum  then
  12.                                 local isplayer =  game.Players:GetPlayerFromCharacter(findmodel)
  13.                                 if isplayer then
  14.                                     if isplayer.Team ~=  currentplayer.Team  then
  15.                         hum:TakeDamage(dmg)
  16.                         task.wait(10)
  17.                         bullettemplate:Destroy()
  18.                                        
  19.                                             if hum.Health <= 0  then
  20.                                                         local findead =  findmodel:FindFirstChild("Dead")
  21.                                                         if findead  then
  22.                                                                 return
  23.                                                         end
  24.                                                         local dead  = Instance.new("IntValue",findmodel)
  25.                                                         dead.Name =  "Dead"
  26.                                                         local leaderstats =  currentplayer.leaderstats
  27.                                                         local kills = leaderstats.Kills
  28.                                                         kills.Value += 1
  29.                                                        
  30.                                                         sendfeed:FireAllClients(currentplayer.Name,isplayer.Name,currentplayer.Team.TeamColor.Color,isplayer.Team.TeamColor.Color)
  31.                                             end    
  32.                                                
  33.                                                
  34.                                                 bullet:Destroy()
  35.                                         end
  36.                                        
  37.                                        
  38.                                 else
  39.                                         bullet:Destroy()
  40.                                         hum:TakeDamage(dmg)
  41.                                 end
  42.                         else
  43.                                 bullet.Position =  hitpos
  44.                         end
  45.               else
  46.                         bullet.Position =  hitpos
  47.               end
  48.          
  49.      
  50.         debris:AddItem(bullet,4)
  51.        
  52.         end
  53.                
  54. end
  55.  
  56. --Set permissinos for roles
  57. local ReplicatedStorage1 = game:GetService("ReplicatedStorage");
  58. local Modules2 = ReplicatedStorage1:WaitForChild("Modules");
  59. local v3 = require(Modules2:WaitForChild("CheckHas"));
  60. local v4 = require(ReplicatedStorage1:WaitForChild("WeaponsSystem"):WaitForChild("WeaponsSystem"));
  61. local v5 = require(script.Parent.Confirmation);
  62. local UserInputService6 = game:GetService("UserInputService");
  63. local v7 = require(game:GetService("ReplicatedStorage").Icon);
  64. local v8 = require(Modules2.LikeGoal);
  65. local LocalPlayer9 = game:GetService("Players").LocalPlayer;
  66. local PlayerGui10 = LocalPlayer9:WaitForChild("PlayerGui");
  67. local mouse11 = LocalPlayer9:GetMouse();
  68. script.Parent.Music.Playing = true;
  69. script.Parent.Enabled = true;
  70. local CurrentCamera12 = workspace.CurrentCamera;
  71. CurrentCamera12.CameraSubject = ReplicatedStorage1.MenuCamera;
  72. CurrentCamera12.CFrame = ReplicatedStorage1.MenuCamera.CFrame;
  73. CurrentCamera12.CameraType = "Scriptable";
  74. local u1 = require(script.spr);
  75. local u2 = script.Parent.Home;
  76. local v13 = tick();
  77. local Home14 = script.Parent:WaitForChild("Home");
  78. local Teams15 = script.Parent:WaitForChild("Teams");
  79. local Store16 = script.Parent:WaitForChild("Store");
  80. local Rules17 = script.Parent:WaitForChild("Rules");
  81. local LikeGoa18 = Home14.LikeGoal;
  82. local v19 = { "Patient", "Employee", "Security Department", "Scientist", "Engineer", "Medical Department" };
  83. local function u3(p1)
  84.     u1.target(u2, 1, 2, {
  85.         Size = UDim2.new(0, 0, 0, 0)
  86.     });
  87.     u1.target(p1, 1, 2, {
  88.         Size = UDim2.new(1, 0, 1, 0)
  89.     });
  90.     u2 = p1;
  91. end;
  92. local Group4 = script.Parent:WaitForChild("Group");
  93. Home14.ButtonClip.Play.MouseButton1Click:Connect(function()
  94.     u3(Group4);
  95. end);
  96. Group4.FACILITY.TextButton.MouseButton1Click:Connect(function()
  97.     u3(Teams15);
  98. end);
  99. Home14.ButtonClip.Store.MouseButton1Click:Connect(function()
  100.     u3(Store16);
  101. end);
  102. Home14.ButtonClip.Rules.MouseButton1Click:Connect(function()
  103.     u3(Rules17);
  104. end);
  105. Rules17.Back.MouseButton1Click:Connect(function()
  106.     u3(Home14);
  107. end);
  108. Teams15.Back.MouseButton1Click:Connect(function()
  109.     u3(Home14);
  110. end);
  111. Group4.Back.MouseButton1Click:Connect(function()
  112.     u3(Home14);
  113. end);
  114. Store16.Back.MouseButton1Click:Connect(function()
  115.     u3(Home14);
  116. end);
  117. local MarketplaceService20 = game:GetService("MarketplaceService");
  118. for v21, v22 in pairs(Store16.ButtonClip:GetChildren()) do
  119.     if v22:IsA("Frame") then
  120.         local v23 = MarketplaceService20:GetProductInfo(tonumber(v22.Name) and 0, Enum.InfoType.GamePass);
  121.         v22.Logo.Image = "rbxassetid://" .. (v23 and v23.IconImageAssetId) and 9117342187;
  122.         if not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(LocalPlayer9.UserId, v22.Name) then
  123.             v22.Buy.MouseButton1Click:Connect(function()
  124.                 if not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(LocalPlayer9.UserId, v22.Name) and v22.Buy.Text ~= "BOUGHT" then
  125.                     game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, v22.Name);
  126.                 end;
  127.             end);
  128.             game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(p2, p3, p4)
  129.                 if p3 == tonumber(v22.Name) and p4 then
  130.                     v22.Buy.Text = "BOUGHT";
  131.                     v22.Title.TextColor3 = Color3.fromRGB(0, 255, 0);
  132.                     v22.Logo.ImageColor3 = Color3.fromRGB(0, 255, 0);
  133.                 end;
  134.             end);
  135.         else
  136.             v22.Buy.Text = "BOUGHT";
  137.             v22.Title.TextColor3 = Color3.fromRGB(0, 255, 0);
  138.             v22.Logo.ImageColor3 = Color3.fromRGB(0, 255, 0);
  139.         end;
  140.     end;
  141. end;
  142. local TeamChanger24 = game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("TeamChanger");
  143. local TweenService25 = game:GetService("TweenService");
  144. local MarketplaceService26 = game:GetService("MarketplaceService");
  145. local v27 = TeamChanger24:InvokeServer("GetTeams");
  146. local v28 = v7.new();
  147. v28:setName("MenuIcon");
  148. v28:setLabel("Menu");
  149. v28:setEnabled(false);
  150. v28:bindEvent("selected", function()
  151.     v28:deselect();
  152.     if TeamChanger24:InvokeServer("ChangeTeam", game.Teams.Choosing) then
  153.         script.Parent.Enabled = true;
  154.         u3(Home14);
  155.         v28:setEnabled(false);
  156.         script.Parent.Music:Play();
  157.         script.Parent.Music.Volume = 0.8;
  158.         script.Parent.Parent.Playerlist.Enabled = false;
  159.         script.Parent.Parent.WardenGui.Enabled = false;
  160.         game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false);
  161.         local CurrentCamera29 = workspace.CurrentCamera;
  162.         CurrentCamera29.CameraSubject = game.ReplicatedStorage.MenuCamera;
  163.         CurrentCamera29.CFrame = game.ReplicatedStorage.MenuCamera.CFrame;
  164.         CurrentCamera29.CameraType = "Scriptable";
  165.         mouse11.Icon = "";
  166.     end;
  167. end);
  168. task.spawn(function()
  169.     LocalPlayer9:WaitForChild("ScavCooldown", math.huge);
  170.     Group4.SCAV.TextButton.MouseButton1Click:Connect(function()
  171.         if game.ReplicatedStorage.Events.CheckCooldownScav:InvokeServer() then
  172.             v5().Pressed:Connect(function()
  173.                 if tonumber(LocalPlayer9.ScavCooldown.Value) > 0 and math.floor(tick() - tonumber(LocalPlayer9.ScavCooldown.Value)) < 300 then
  174.                     return;
  175.                 end;
  176.                 if game.ReplicatedStorage.Events.RequestScav:InvokeServer() then
  177.                     script.Parent.Music.Volume = 0;
  178.                     u3(Home14);
  179.                     script.Parent.Enabled = false;
  180.                     script.Parent.Parent.Playerlist.Enabled = true;
  181.                     script.Parent.Parent.WardenGui.Enabled = true;
  182.                     v28:setEnabled(true);
  183.                     game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true);
  184.                     local CurrentCamera30 = workspace.CurrentCamera;
  185.                     CurrentCamera30.CameraSubject = game.Players.LocalPlayer.Character.Humanoid;
  186.                     CurrentCamera30.CameraType = "Custom";
  187.                     game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false);
  188.                     game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true);
  189.                     task.wait(0.3);
  190.                 end;
  191.             end);
  192.             return;
  193.         end;
  194.         game.StarterGui:SetCore("SendNotification", {
  195.             Title = "Notification",
  196.             Text = "Scavenger raid is on cooldown.",
  197.             Icon = "",
  198.             Duration = 5
  199.         });
  200.     end);
  201. end);
  202. ReplicatedStorage1:WaitForChild("Events"):WaitForChild("ScavMenu").OnClientEvent:Connect(function()
  203.     script.Parent.Enabled = true;
  204.     u3(Home14);
  205.     v28:setEnabled(false);
  206.     script.Parent.Music:Play();
  207.     script.Parent.Music.Volume = 0.8;
  208.     script.Parent.Parent.Playerlist.Enabled = false;
  209.     script.Parent.Parent.WardenGui.Enabled = false;
  210.     game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false);
  211.     local CurrentCamera31 = workspace.CurrentCamera;
  212.     CurrentCamera31.CameraSubject = game.ReplicatedStorage.MenuCamera;
  213.     CurrentCamera31.CFrame = game.ReplicatedStorage.MenuCamera.CFrame;
  214.     CurrentCamera31.CameraType = "Scriptable";
  215.     mouse11.Icon = "";
  216. end);
  217. for v32, v33 in pairs(v27) do
  218.     if v33.Name ~= "Solitary" and v33.Name ~= "Choosing" and v33.Name ~= "Scav" then
  219.         coroutine.wrap(function()
  220.             if table.find(v19, v33.Name) then
  221.                 task.wait(0.1 * table.find(v19, v33.Name));
  222.             else
  223.                 task.wait(0.1 * (#v19 + 0.1));
  224.             end;
  225.             local v34 = script.Template:Clone();
  226.             v34.Parent = Teams15.ButtonClip;
  227.             if v33.Name == "Intelligence Agency" then
  228.                 v34.TextLabel.Text = "Site Intelligence";
  229.             elseif v33.Name == "Executive" then
  230.                 v34.TextLabel.Text = "Site Administration";
  231.             else
  232.                 v34.TextLabel.Text = v33.Name;
  233.             end;
  234.             v34.Name = v33.Name;
  235.             v34.TextLabel.TextColor3 = v33.TeamColor.Color;
  236.             local TextButton35 = v34:WaitForChild("TextButton");
  237.             local Lock36 = v34:WaitForChild("Lock");
  238.             local Slots37 = v34:WaitForChild("Slots");
  239.             local SlotBoxes38 = v34:WaitForChild("SlotBoxes");
  240.             local FreeSlots39 = v33:FindFirstChild("FreeSlots");
  241.             if FreeSlots39 then
  242.                 Slots37.Visible = true;
  243.                 for v40 = 1, FreeSlots39.Value do
  244.                     local v41 = SlotBoxes38.UIGridLayout.Slot:Clone();
  245.                     v41.Name = v40;
  246.                     v41.LayoutOrder = v40;
  247.                     v41.Parent = SlotBoxes38;
  248.                 end;
  249.             else
  250.                 Slots37.Visible = false;
  251.                 SlotBoxes38.Visible = false;
  252.             end;
  253.             if FreeSlots39 or v33.Name == "Patient" then
  254.                 v34.LayoutOrder = -1;
  255.             end;
  256.             local u5 = FreeSlots39 and #FreeSlots39:GetChildren();
  257.             local function v42()
  258.                 if not FreeSlots39 then
  259.                     return;
  260.                 end;
  261.                 u5 = FreeSlots39 and #FreeSlots39:GetChildren();
  262.                 Slots37.Text = u5 .. "/" .. FreeSlots39.Value .. " Free Slots";
  263.                 for v43, v44 in pairs(SlotBoxes38:GetChildren()) do
  264.                     if v44:IsA("Frame") then
  265.                         local v45 = tonumber(v44.Name);
  266.                         if v45 and v45 <= u5 then
  267.                             v44.BackgroundColor3 = Color3.new(1, 1, 1);
  268.                             v44.BackgroundTransparency = 0;
  269.                         else
  270.                             v44.BackgroundColor3 = Color3.new(0.105882, 0.105882, 0.105882);
  271.                             v44.BackgroundTransparency = 0.5;
  272.                         end;
  273.                     end;
  274.                 end;
  275.             end;
  276.             v42();
  277.             v34.Visible = true;
  278.             if FreeSlots39 then
  279.                 FreeSlots39.ChildAdded:Connect(v42);
  280.                 FreeSlots39.ChildRemoved:Connect(v42);
  281.             end;
  282.             v34.TextButton.MouseEnter:Connect(function()
  283.                 game.Lighting.Hover:Play();
  284.                 v34.TextButton.UIStroke.Color = Color3.fromRGB(255, 200, 0);
  285.                 v34.TextButton.TextColor3 = Color3.fromRGB(255, 200, 0);
  286.             end);
  287.             Lock36.MouseEnter:Connect(function()
  288.                 game.Lighting.Hover:Play();
  289.                 Lock36.ImageColor3 = Color3.fromRGB(255, 200, 0);
  290.             end);
  291.             v34.TextButton.MouseLeave:Connect(function()
  292.                 v34.TextButton.UIStroke.Color = Color3.fromRGB(255, 255, 255);
  293.                 v34.TextButton.TextColor3 = Color3.fromRGB(255, 255, 255);
  294.             end);
  295.             Lock36.MouseLeave:Connect(function()
  296.                 Lock36.ImageColor3 = Color3.new(1, 1, 1);
  297.             end);
  298.             local function v46()
  299.                 game.Lighting.Click:Play();
  300.                 local v47 = TeamChanger24:InvokeServer("ChangeTeam", v33);
  301.                 if not v47 then
  302.                     if not v47 then
  303.                         task.spawn(function()
  304.                             script.Parent.ErrorFX.Visible = true;
  305.                             script.Parent.Error:TweenPosition(UDim2.new(0.5, 0, 1.1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1, false);
  306.                             script.Parent.ErrorFX:TweenPosition(UDim2.new(0.5, 2, 1.1, 2), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1, false);
  307.                             task.wait(3);
  308.                             script.Parent.Error:TweenPosition(UDim2.new(0.5, 0, 1.3, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1.5, false);
  309.                             script.Parent.ErrorFX:TweenPosition(UDim2.new(0.5, 2, 1.3, 2), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1.5, false);
  310.                             task.wait(1.5);
  311.                             script.Parent.Error.Visible = false;
  312.                             script.Parent.ErrorFX.Visible = false;
  313.                         end);
  314.                     end;
  315.                     return;
  316.                 end;
  317.                 script.Parent.Music.Volume = 0;
  318.                 u3(Home14);
  319.                 script.Parent.Enabled = false;
  320.                 script.Parent.Parent.Playerlist.Enabled = true;
  321.                 script.Parent.Parent.WardenGui.Enabled = true;
  322.                 v28:setEnabled(true);
  323.                 game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true);
  324.                 local CurrentCamera48 = workspace.CurrentCamera;
  325.                 CurrentCamera48.CameraSubject = game.Players.LocalPlayer.Character.Humanoid;
  326.                 CurrentCamera48.CameraType = "Custom";
  327.                 game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false);
  328.                 game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true);
  329.                 task.wait(0.3);
  330.             end;
  331.             v34.TextButton.Activated:Connect(v46);
  332.             Lock36.Activated:Connect(v46);
  333.             coroutine.wrap(function()
  334.                 while v34 do
  335.                     if script.Parent.Enabled then
  336.                         if v3.PermsToJoinTeam(LocalPlayer9, v33) then
  337.                             Lock36.Visible = false;
  338.                             Lock36.Active = false;
  339.                             TextButton35.Visible = true;
  340.                             TextButton35.Active = true;
  341.                         else
  342.                             Lock36.Visible = true;
  343.                             Lock36.Visible = true;
  344.                             TextButton35.Visible = false;
  345.                             TextButton35.Active = false;
  346.                         end;
  347.                     end;
  348.                     wait(0.25);            
  349.                 end;
  350.             end)();
  351.         end)();
  352.     end;
  353. end;
  354. game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false);
  355. local u6 = tick();
  356. game:GetService("UserInputService").InputBegan:Connect(function(p5, p6)
  357.     if not p6 and p5.KeyCode == Enum.KeyCode.M then
  358.         if not script.Parent.Enabled and tick() - u6 < 0.4 and TeamChanger24:InvokeServer("ChangeTeam", game.Teams.Choosing) then
  359.             script.Parent.Enabled = true;
  360.             v28:setEnabled(false);
  361.             u3(Home14);
  362.             script.Parent.Music:Play();
  363.             script.Parent.Music.Volume = 0.8;
  364.             script.Parent.Parent.Playerlist.Enabled = false;
  365.             script.Parent.Parent.WardenGui.Enabled = false;
  366.             script.Parent.Music.Playing = true;
  367.             game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false);
  368.             local CurrentCamera49 = workspace.CurrentCamera;
  369.             CurrentCamera49.CameraSubject = game.ReplicatedStorage.MenuCamera;
  370.             CurrentCamera49.CFrame = game.ReplicatedStorage.MenuCamera.CFrame;
  371.             CurrentCamera49.CameraType = "Scriptable";
  372.         end;
  373.         u6 = tick();
  374.     end;
  375. end);
  376. v4.camera:setEnabled(false);
  377. mouse11.Icon = "";
  378. UserInputService6.MouseIconEnabled = true;
  379. while wait(1) do
  380.     if script.Parent.Enabled then
  381.         mouse11.Icon = "";
  382.         LikeGoa18.GoalCounter.Text = v8:GetThumbsUp() .. "/" .. v8.CurrentGoal;
  383.         local v50 = v8:GetThumbsUp() / v8.CurrentGoal;
  384.         if v50 > 1 then
  385.             v50 = 1;
  386.         end;
  387.         LikeGoa18.Progress.Percentage.Size = UDim2.new(v50, 0, 1, 0);
  388.     end;
  389. end;
  390.  
  391.  
  392. --Script CheckHas
  393.  
  394. local v1 = {
  395.     Rank = function(p1, p2, p3)
  396.         if p1 and p2 and type(p2) == "number" and p3 then
  397.             local v2 = p1:GetRankInGroup(p2);
  398.             if type(p3) == "number" and p3 <= v2 then
  399.                 return true;
  400.             end;
  401.             if type(p3) == "table" and p3[1] < v2 and v2 <= p3[2] then
  402.                 return true;
  403.             end;
  404.         end;
  405.         return false;
  406.     end
  407. };
  408. local MarketplaceService1 = game:GetService("MarketplaceService");
  409. function v1.Gamepass(p4, p5)
  410.     return MarketplaceService1:UserOwnsGamePassAsync(p4.UserId and 0, p5 and 0);
  411. end;
  412. local u2 = {};
  413. function v1.PermsToJoinTeam(LocalPlayer, Team)
  414.     local v3, v4, v5 = pairs(Team:GetChildren());
  415.     while true do
  416.         local v6, v7 = v3(v4, v5);
  417.         if not v6 then
  418.             break;
  419.         end;
  420.         if v7.Name == "groupID" and v1.Rank(LocalPlayer, v7.Value, v7.minRank.Value) then
  421.             return true;
  422.         end;
  423.         if string.find(v7.Name, "Gamepass") and v1.Gamepass(LocalPlayer, v7.Value) then
  424.             return true;
  425.         end;
  426.         if v7.Name == "FreeSlots" and #v7:GetChildren() < v7.Value then
  427.             return true;
  428.         end;
  429.         if v7.Name == "Premium" and v7.Value == true and LocalPlayer.MembershipType == Enum.MembershipType.Premium then
  430.             return true;
  431.         end;
  432.         if u2[LocalPlayer.UserId] then
  433.             return true;
  434.         end;   
  435.     end;
  436.     return false;
  437. end;
  438. return v1;
  439.  
Add Comment
Please, Sign In to add comment