Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This is a small bot by supersonicfan111
- -- This was made quickly, and is not efficient, probably
- -- Feel free to make it better, etc, :)
- Plr = owner or game:GetService("Players").LocalPlayer
- P = Plr.Character
- P.Archivable = true
- local Dum = P:Clone()
- Dum.Parent = workspace
- local chr=Dum
- CLerp=function(startcf, endcf, alpha)
- return startcf:lerp(endcf, alpha)
- end
- local RH=Instance.new('Weld',chr.Torso)
- RH.Name="Right Hip"
- RH.Part0=chr.Torso
- RH.Part1=chr['Right Leg']
- RH.C0=CFrame.new(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
- RH.C1=CFrame.new(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
- local LH=Instance.new('Weld',chr.Torso)
- LH.Name="Left Hip"
- LH.Part0=chr.Torso
- LH.Part1=chr['Left Leg']
- LH.C0=CFrame.new(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
- LH.C1=CFrame.new(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
- local RS=Instance.new('Weld',chr.Torso)
- RS.Name="Right Shoulder"
- RS.Part0=chr.Torso
- RS.Part1=chr['Right Arm']
- RS.C0=CFrame.new(1.5,0.5,0)
- RS.C1=CFrame.new(0, 0.5, 0)
- local LS=Instance.new('Weld',chr.Torso)
- LS.Name="Left Shoulder"
- LS.Part0=chr.Torso
- LS.Part1=chr['Left Arm']
- LS.C0=CFrame.new(-1.5,0.5,0)
- LS.C1=CFrame.new(0, 0.5, 0)
- LHC0=CFrame.new(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
- RHC0=CFrame.new(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
- local sine=0
- local change=.1
- local Anim="Idle"
- local cf=CFrame.new
- local sin=math.sin
- local rad=math.rad
- local attack=false
- local angles=CFrame.Angles
- local euler=CFrame.fromEulerAnglesXYZ
- local Character=chr
- local Humanoid=Character:findFirstChild'Humanoid'
- local RootPart=chr.HumanoidRootPart
- function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
- return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
- end
- Humanoid.WalkSpeed=10
- Humanoid.MaxHealth=50
- Humanoid.Health=50
- local injured=false
- local RSC0=CFrame.new(1.5,0.5,0)
- local LSC0=cf(-1.5,0.5,0)
- spawn(function()
- while wait() do
- sine=sine+change
- sine = sine + change
- local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
- local velderp=RootPart.Velocity.y
- hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
- if torvel > 4 and torvel < 16 and hitfloor then
- Anim="Walk"
- end
- if RootPart.Velocity.y > 1 and hitfloor==nil then
- Anim="Jump"
- elseif RootPart.Velocity.y < -1 and hitfloor==nil then
- Anim="Fall"
- elseif torvel<1 and hitfloor then
- Anim="Idle"
- elseif torvel >= 16 and hitfloor then
- Anim="Run"
- end
- end
- end)
- local popcorn=true
- spawn(function()
- while wait() do
- if Humanoid.Health==Humanoid.MaxHealth then
- popcorn=true
- elseif Humanoid.Health==Humanoid.MaxHealth/2 then
- popcorn=false
- Humanoid.WalkSpeed=8
- elseif Humanoid.Health==10 then
- popcorn=false
- Humanoid.WalkSpeed=4
- end
- end
- end)
- spawn(function()
- while wait() do
- if Humanoid.Jump and injured then
- Humanoid.Jump=false
- end
- end
- end)
- local tracking=false
- moveBot=function()
- local x=math.random(-450, 450)
- local z=math.random(-450, 450)
- local pos=Vector3.new(x,0,z)
- Humanoid:MoveTo(pos)
- end
- moveBot()
- spawn(function()
- while wait(4) do
- moveBot()
- end
- end)
- while wait() do
- if Anim=='Walk' then
- change=.1
- if not attack then
- LS.C0=CLerp(LS.C0, LSC0*angles(sin(sine), 0, 0), .2)
- RS.C0=CLerp(RS.C0, RSC0*angles(-sin(sine), 0, 0), .2)
- end
- LH.C0=CLerp(LH.C0, LHC0*angles(0, 0, sin(sine)), .2)
- RH.C0=CLerp(RH.C0, RHC0*angles(0, 0, sin(sine)), .2)
- elseif Anim=='Idle' then
- change=0
- if not attack then
- LS.C0=CLerp(LS.C0, LSC0*angles(0, 0, -rad(10)), .2)
- RS.C0=CLerp(RS.C0, RSC0*angles(0, 0, rad(10)), .2)
- LH.C0=CLerp(LH.C0, LHC0*angles(-rad(10), 0, 0), .2)
- RH.C0=CLerp(RH.C0, RHC0*angles(-rad(10), 0, 0), .2)
- end
- elseif Anim=='Jump' then
- if not attack then
- LS.C0=CLerp(LS.C0, LSC0*angles(0, 0, math.rad(-150)), .2)
- RS.C0=CLerp(RS.C0, RSC0*angles(0, 0, math.rad(150)), .2)
- LH.C0=CLerp(LH.C0, LHC0*angles(0, 0, 0), .2)
- RH.C0=CLerp(RH.C0, RHC0*angles(0, 0, 0), .2)
- end
- elseif Anim=='Fall' then
- if not attack then
- LS.C0=CLerp(LS.C0, LSC0*angles(0, 0, rad(-45)), .2)
- RS.C0=CLerp(RS.C0, RSC0*angles(0, 0, rad(45)), .2)
- LH.C0=CLerp(LH.C0, LHC0*angles(0, 0, 0), .2)
- RH.C0=CLerp(RH.C0, RHC0*angles(0, 0, 0), .2)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement