Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --~boxrum~dojj0~indencito~
- --width 4
- --height 5
- --reach 5.87(6)
- --radius max = reach
- _G.ER = true
- local run
- local p = game.Players.LocalPlayer
- local c = p.Character or p.CharacterAdded:Wait()
- local new
- local hum = c:WaitForChild("Humanoid",5) or c:FindFirstChildOfClass("Humanoid")
- local m = p:GetMouse()
- local on = false
- local lastDeath = tick()
- new=Instance.new("BodyGyro",c:WaitForChild("HumanoidRootPart"))
- new.D=500
- new.P=300000
- new.MaxTorque=(on==true)and(Vector3.new(0, 400000000, 0))or(Vector3.new(0,0,0))
- p.CharacterAdded:Connect(function(c2) c=c2;
- hum=c2:WaitForChild("Humanoid")or(c2:FindFirstChildOfClass("Humanoid"));
- new=Instance.new("BodyGyro",c2:WaitForChild("HumanoidRootPart"));
- new.D=500;
- new.P=300000;
- new.MaxTorque=(on==true)and(Vector3.new(0, 400000000, 0))or(Vector3.new(0,0,0));
- end)
- m.KeyDown:Connect(function(k)
- if string.lower(k) == "e" then
- on=(on==false)and(true)or(false)
- new.MaxTorque=(on==true)and(Vector3.new(0, 400000000, 0))or(Vector3.new(0,0,0))
- end
- end)
- repeat wait() until c
- if c then
- repeat wait() until c.PrimaryPart and hum
- print("yes character")
- local rp = c.PrimaryPart
- local whitelist = "humanoid2"
- local curT
- local lastrando = math.random(1,10)
- function returnAllTools()
- local all = workspace:GetDescendants()
- local newT = {}
- for i = 1,#all do
- if all[i].ClassName == "Tool" then
- table.insert(newT,all[i])
- end
- end
- return table.unpack(newT)
- end
- function sword()
- local find = c:FindFirstChildOfClass("Tool") or p.Backpack:FindFirstChildOfClass("Tool")
- if find and find:FindFirstChildOfClass('Part') and tick()-lastDeath>=.5 then
- find.Parent = c
- end
- return find
- end
- function activate()
- local s = sword()
- if s then
- for i = 1,2 do
- s:Activate()
- end
- end
- end
- if rp then
- --rp:SetNetworkOwner(nil)
- hum.Died:Connect(function()
- warn(curT)
- end)
- function step()
- if _G.ER == false then
- if run then
- run:Disconnect()
- end
- print("MANUAL OVERRIDE")
- end
- if on == true and c and new and hum and hum.Health>0 then
- rp = c.PrimaryPart
- local closest = {nil,math.huge}
- local all = workspace:GetDescendants()
- for i = 1,#all do
- local h = all[i]:FindFirstChildOfClass("Humanoid")
- if h and h.Health>0 and all[i]~=c and h.Name~=whitelist then
- local hrp = all[i].PrimaryPart
- if hrp and rp then
- local mag = (hrp.Position-rp.Position).Magnitude
- if mag<closest[2] then
- --print(hrp.Position, rp.Position)
- closest[1] = hrp
- closest[2] = mag
- closest[3] = h
- end
- end
- end
- end
- if closest[1] and closest[3] then
- local c2 = closest[1].Parent
- --removed the retrieving of the opponent player object
- local all2 = c2:GetChildren()
- local close = {nil,math.huge}
- local from = CFrame.new(0,0,0)
- for i = 1,#all2 do
- if all2[i].ClassName == "Part" or all2[i].ClassName == "MeshPart" or all2[i].ClassName == "UnionOperation" then
- local mag2 = ((rp.Position+Vector3.new(0,2.5,0))-all2[i].Position).Magnitude
- if mag2 < close[2] then
- close[2] = mag2
- close[1] = all2[i]
- end
- end
- end
- if close[1] and closest[1] and rp and sword() then
- --print(close[2])
- local shift = 0
- local from = closest[1].CFrame:ToObjectSpace(rp.CFrame)
- local zPos = from.Position.Z
- local xPos = from.Position.X
- --away sword -1
- local calc = (xPos>=2 or zPos>0) and 1 or -1
- shift = calc
- ---print(xPos/closest[2])
- if c and sword() and close[2]<=(7+(close[1].Velocity.Magnitude)) then
- activate()
- end
- local _match = string.match(close[1].Name,"%a+%s(Leg)")
- if _match~=nil then
- --print(close[1].Name)
- hum.Jump = true
- if sword() then
- activate()
- end
- hum:MoveTo((CFrame.new(close[1].Position,rp.Position)*CFrame.new(shift,0,-12)).Position)
- else
- hum:MoveTo((CFrame.new(close[1].Position,rp.Position)*CFrame.new(shift,0,-5.5)).Position)
- end
- local ray = Ray.new(sword().Handle.Position,close[1].Position-sword().Handle.Position)
- local hit,pos = workspace:FindPartOnRayWithIgnoreList(ray,{c,returnAllTools()})
- new.CFrame = CFrame.new(sword().Handle.Position,not hit and close[1].Position or pos)
- curT = close[1].Name
- end
- end
- else
- if hum.Health<=0 then
- lastDeath = tick()
- end
- end
- end
- run = game:GetService("RunService").RenderStepped:Connect(step)
- else
- print(rp,hum)
- end
- end
Add Comment
Please, Sign In to add comment