Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local humanoid = player.Character.Humanoid
- local userInputService = game:GetService("UserInputService")
- local isEnabled = false
- local scriptURL = "https://raw.githubusercontent.com/78n/Amity/main/KillAura.lua"
- local scriptInstance = nil
- local maxDistance = 30
- local originalSpeed = humanoid.WalkSpeed
- local newSpeed = 19
- local function findClosestPlayer()
- local closestDistance = maxDistance
- local closestPlayer = nil
- for _, otherPlayer in pairs(game.Players:GetPlayers()) do
- if otherPlayer ~= player then
- local character = otherPlayer.Character
- if character and character:FindFirstChild("HumanoidRootPart") then
- local distance = (character.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude
- if distance < closestDistance then
- closestDistance = distance
- closestPlayer = otherPlayer
- end
- end
- end
- end
- return closestPlayer
- end
- local function followTarget()
- local target = findClosestPlayer()
- if target then
- humanoid:MoveTo(target.Character.HumanoidRootPart.Position)
- end
- end
- local function enableScript()
- isEnabled = true
- humanoid.WalkSpeed = newSpeed
- followTarget()
- scriptInstance = loadstring(game:HttpGetAsync(scriptURL))
- scriptInstance()
- end
- local function disableScript()
- isEnabled = false
- humanoid.WalkSpeed = originalSpeed
- humanoid:MoveTo(player.Character.HumanoidRootPart.Position)
- if scriptInstance then
- scriptInstance = nil
- end
- end
- local function onCharacterAdded(character)
- local target = findClosestPlayer()
- if target then
- target.CharacterAdded:Connect(function(char)
- char.Humanoid.Jumping:Connect(function()
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- end)
- end)
- end
- end
- player.CharacterAdded:Connect(onCharacterAdded)
- userInputService.InputBegan:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.X then
- if isEnabled then
- disableScript()
- else
- enableScript()
- end
- end
- end)
- while true do
- if isEnabled then
- followTarget()
- end
- wait(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement