The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Counter Blox script pastebin roblox
By LINK GAME on 2024-09-20 08:00 am | Syntax: LUA | Views: 10



New Script | Raw | Show/Hide line no. | Copy text to clipboard
  1. local Distance = 100 -- distance
  2. local Interval = 0 -- how many seconds to wait
  3. local TeamCheck = true -- team check
  4.  
  5. local function GetPlayersWithData(Teams, Distance)
  6.     local Team = Teams == true and 'TeamCheck' or false
  7.     for i,v in next, game.Players:GetPlayers() do
  8.         if (Team == 'TeamCheck' and v.Team ~= game.Players.LocalPlayer.Team or (not Team and true)) and v.Character and v.Character:FindFirstChild('HumanoidRootPart') and v.Character:FindFirstChild('Humanoid') and v.Character.Humanoid.Health ~= 0 and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild('HumanoidRootPart') then
  9.             local Magnitude =  (game.Players.LocalPlayer.Character.HumanoidRootPart.Position-v.Character.HumanoidRootPart.Position).magnitude
  10.             if Magnitude <= Distance then
  11.                 return v.Character.Head
  12.             end
  13.         end
  14.     end
  15.     return false
  16. end
  17.  
  18. while wait(Interval) do
  19.     local CorrectPart = GetPlayersWithData(TeamCheck, Distance)
  20.  
  21.     if CorrectPart ~= false and game.Players.LocalPlayer.Character:FindFirstChild('Gun')  then
  22.         game:GetService("ReplicatedStorage").Events.HitPart:FireServer(CorrectPart, CorrectPart.Position, 'AK47', 8192, game.Players.LocalPlayer.Character:FindFirstChild('Gun'), nil, nil, 1, false, false, Vector3.new(0,0,0), 6761, Vector3.new(0,0,0))
  23.     end
  24. end