Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This is experimental and should perform better than V2
- local Players = game:GetService("Players")
- local LPlayer = Players.LocalPlayer
- local RunService = game:GetService("RunService")
- --_G.Range = 10
- --_G.Whitelist = {}
- --_G.Blacklist = {}
- --_G.TeamCheck = false
- --_G.SwordAutoEnabled = true
- local function CheckPlayer(Player)
- if Player and Player.Character and LPlayer and LPlayer.Character then
- local Char = Player.Character
- local Root = Char:FindFirstChild("HumanoidRootPart")
- local Humanoid = Char:FindFirstChild("Humanoid")
- if Root and Humanoid and Humanoid.Health > 0 then
- if (LPlayer.Character.HumanoidRootPart.Position - Root.Position).Magnitude <= _G.Range then -- RANGE
- -- Custom Parameters
- if (#_G.Blacklist == 0) and (#_G.Whitelist > 0) then -- If WHITELIST
- for i, Whitelist in pairs(_G.Whitelist) do
- if Player.Name == Whitelist or Player.DisplayName == Whitelist then
- return
- end
- end
- elseif (#_G.Blacklist) > 0 and (_G.Whitelist == 0) then -- If BLACKLIST
- for i, Blacklist in pairs(_G.Blacklist) do
- if Player.Name == Blacklist or Player.DisplayName == Blacklist then
- return true
- else
- return
- end
- end
- end
- if (_G.TeamCheck == true) and not(LPlayer.Team == nil) and (LPlayer.Team == Player.Team) then -- Team CHECK
- return
- end
- return true
- end
- end
- end
- end
- local RunSetting = RunService.RenderStepped:Connect(function()
- if _G.SwordAutoEnabled then
- for i, Player in pairs(game.Players:GetPlayers()) do
- local Check = CheckPlayer(Player)
- if Check then
- local Character = Player.Character
- local Sword = LPlayer.Character:FindFirstChildOfClass("Tool")
- if Sword and Sword:FindFirstChild("Handle") then
- Sword:Activate()
- firetouchinterest(Sword.Handle, Character.HumanoidRootPart, 0)
- firetouchinterest(Sword.Handle, Character.HumanoidRootPart, 1)
- end
- end
- end
- end
- end)
- repeat
- task.wait()
- until _G.SwordAutoEnabled == false
- RunSetting:Disconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement