Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- warn[[
- Mr.Brick
- Made by projor22
- ]]
- --literally just mr.brick but i badly added a animation to it
- local player = owner
- local old = nil
- local character = player.Character
- local mod = Instance.new("Model",workspace) mod.Name=">Mr.Brick<"
- local hed = Instance.new("FlagStand",mod) hed.Size = Vector3.new(2,1,1) hed.Name = "Head" hed.Transparency=0 hed.Anchored=false hed.CanCollide=false
- local mesh = Instance.new("SpecialMesh",hed) mesh.MeshId="rbxassetid://1104623876" mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
- local tor = Instance.new("FlagStand",mod) tor.Name = "Torso" tor.Size = Vector3.new(2,2,1) tor.Transparency=0 tor.Anchored=false tor.CanCollide=true
- local right_arm = Instance.new("FlagStand",mod) right_arm.Size=Vector3.new(1,2,1) right_arm.Transparency=0 right_arm.Name = "Right Arm" right_arm.Anchored=false
- local left_arm = Instance.new("FlagStand",mod) left_arm.Size=Vector3.new(1,2,1) left_arm.Transparency=0 left_arm.Name = "Left Arm" left_arm.Anchored=false
- local right_leg = Instance.new("FlagStand",mod) right_leg.Size=Vector3.new(1,2,1) right_leg.Transparency=0 right_leg.Name = "Right Leg" right_leg.Anchored=false
- local left_leg = Instance.new("FlagStand",mod) left_leg.Size=Vector3.new(1,2,1) left_leg.Transparency=0 left_leg.Name = "Left Leg" left_leg.Anchored=false
- local faker = Instance.new("FlagStand",mod) faker.Name = " " faker.Size = Vector3.new(2.001,2.001,1.001)
- local weld = Instance.new("Weld",faker) weld.Part0=faker weld.Part1=tor
- local old = nil
- old = tor
- local Torso = tor
- old=tor
- function makeJoint(limbName, jointName, c0, c1)
- local limb = limbName
- limb:BreakJoints()
- local joint = Instance.new"Motor6D"
- joint.Name = jointName
- joint.Part0 = Torso
- joint.Part1 = limb
- joint.C0 = c0
- joint.C1 = c1
- joint.MaxVelocity = 0.1
- joint.archivable = false
- joint.Parent = Torso
- return joint
- end
- local Neck = makeJoint(hed,"Neck", CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0))
- local RightShoulder = makeJoint(right_arm, "Right Shoulder", CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
- local LeftShoulder = makeJoint(left_arm, "Left Shoulder", CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
- local RightHip = makeJoint(right_leg, "Right Hip", CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0))
- local LeftHip = makeJoint(left_leg, "Left Hip", CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0))
- if character then
- local torsotest = character:FindFirstChild("Torso")
- if torsotest then
- tor.CFrame = torsotest.CFrame
- player.Character = mod
- else
- local headtest = character:FindFirstChild("Head")
- if headtest then
- hed.CFrame=headtest.CFrame
- player.Character = mod
- else
- local fake = workspace:FindFirstChild("fakerhead")
- if fake then
- hed.CFrame=fake.CFrame
- player.Character = mod
- else
- print("respawning")
- player:LoadCharacter()
- wait(.4)
- player.Character = mod
- end
- end
- end
- else
- print("respawning")
- player:LoadCharacter()
- wait(.4)
- player.Character = mod
- end
- local f = Instance.new("ForceField",mod) f.Visible=false f.Name=" "
- local remo = Instance.new("RemoteEvent",mod) remo.Name="guess"
- local ghostify = false
- hm=false
- remo.OnServerEvent:Connect(function(pl, attack)
- if hm == false then
- if ghostify == false then
- ghostify=true
- local motor = player.Character.Torso:FindFirstChild("Right Shoulder")
- local motor2 = player.Character.Torso:FindFirstChild("Left Shoulder")
- if motor then
- if motor2 then
- motor2.DesiredAngle=-1.56
- end
- motor.DesiredAngle=1.56
- local head = hed
- if head then
- local look = head:FindFirstChild("Decal")
- if look then
- else
- end
- end
- end
- else
- ghostify=false
- local motor = player.Character.Torso:FindFirstChild("Left Shoulder")
- local motor2 = player.Character.Torso:FindFirstChild("Right Shoulder")
- if motor2 then
- if motor then
- motor.DesiredAngle=0
- end
- motor2.DesiredAngle=0
- end
- end
- end
- end)
- function Kill(die)
- die:BreakJoints()
- die.Name="part"
- die.Color = Color3.new(.5,.5,.5)
- for i,g in pairs(die:GetDescendants()) do
- if g:IsA("BasePart") then
- g:BreakJoints()
- g.Color = Color3.new(.5,.5,.5)
- g.Name="part"
- local bp = Instance.new("BodyVelocity",g)
- bp.MaxForce = Vector3.new(0,math.huge,0)
- end
- end
- end
- tor.Touched:Connect(function(par)
- if ghostify==true then
- if par.Parent ~= workspace and par.Parent ~= workspace.Terrain and not par:IsDescendantOf(mod) then
- for i,g in pairs(par.Parent:GetDescendants()) do
- if g:IsA("BasePart") then
- if g.Name=="BasePlate" then
- else
- Kill(g)
- end
- end
- end
- end
- end
- end)
- local rem = Instance.new("RemoteEvent",player.Character) rem.Name="yes"
- local tel = Instance.new("RemoteEvent",player.Character) tel.Name="tp"
- local killer = Instance.new("RemoteEvent",player.Character) killer.Name="lIIl"
- local wave = true
- rem.OnServerEvent:connect(function(plr, wav)
- if wav then
- if hm == false then
- if ghostify==false then
- if wave == true then
- wave=false
- local motor = player.Character.Torso:FindFirstChild("Right Shoulder")
- if motor then
- motor.DesiredAngle=3.144
- end
- else
- wave=true
- local motor2 = player.Character.Torso:FindFirstChild("Right Shoulder")
- if motor2 then
- motor2.DesiredAngle=0
- end
- end
- end
- end
- end
- end)
- tel.OnServerEvent:connect(function(plr, position)
- tor.Position=position + Vector3.new(0,3,0)
- end)
- killer.OnServerEvent:connect(function(plr, target)
- local mt=target
- if mt then
- if mt.Parent.ClassName == "Model" then
- Kill(mt.Parent)
- elseif mt.Parent.Parent.ClassName == "Model" then
- Kill(mt.Parent.Parent)
- end
- end
- end)
- local leftarm = Instance.new("CharacterMesh",mod)
- leftarm.BodyPart = Enum.BodyPart.LeftArm
- leftarm.MeshId= "1112256772"
- local righttarm = Instance.new("CharacterMesh",mod)
- righttarm.BodyPart = Enum.BodyPart.RightArm
- righttarm.MeshId = "1112244824"
- local leftleg = Instance.new("CharacterMesh",mod)
- leftleg.BodyPart = Enum.BodyPart.LeftLeg
- leftleg.MeshId = "1112275294"
- local rightleg = Instance.new("CharacterMesh",mod)
- rightleg.BodyPart = Enum.BodyPart.RightLeg
- rightleg.MeshId = "1112267576"
- local torso = Instance.new("CharacterMesh",mod)
- torso.BodyPart = Enum.BodyPart.Torso
- torso.MeshId = "1112228624"
- NLS([[
- local player = game:GetService("Players").LocalPlayer
- local hum = Instance.new("Humanoid",player.Character) hum.MaxHealth = -300 hum.Health=-300 hum.Name = "" hum.BreakJointsOnDeath=false hum.RequiresNeck=false hum.WalkSpeed=17
- workspace.CurrentCamera:Destroy()
- wait()
- workspace.CurrentCamera.CameraSubject = hum
- workspace.CurrentCamera.CameraType = "Custom"
- local mouse = player:GetMouse()
- local remote = player.Character:WaitForChild("guess")
- local r = player.Character:WaitForChild("yes")
- local teleport = player.Character:WaitForChild("tp")
- local kills = player.Character:WaitForChild("lIIl")
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'c' then
- remote:FireServer("attack")
- end
- end)
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'x' then
- r:FireServer("wav")
- end
- end)
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'z' then
- teleport:FireServer(mouse.Hit.p)
- end
- end)
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'e' then
- kills:FireServer(mouse.Target)
- end
- end)
- ]],player.Character)
- local RunService = game:GetService("RunService")
- local RATE_PER_SECOND = 2
- RunService.Heartbeat:Connect(function(step)
- local increment = RATE_PER_SECOND * step
- if tor then
- else
- end
- end)
- NLS([[
- function newSound(id,Parent1)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.Parent = Parent1
- return sound
- end
- local Player = game:GetService("Players").LocalPlayer
- local Figure = Player.Character
- local Torso = Figure:WaitForChild("Torso")
- local Lefthip = Torso:WaitForChild("Left Hip")
- local Righthip = Torso:WaitForChild("Right Hip")
- local Humanoid = Figure:FindFirstChildOfClass("Humanoid")
- local Rightshoulder = Torso:WaitForChild("Right Shoulder")
- local Leftshoulder = Torso:WaitForChild("Left Shoulder")
- local walkspeed = Humanoid.WalkSpeed
- local P = game:GetService("PathfindingService")
- local movespeed = 1
- local jumpMaxLimbVelocity = 0.5/3
- local ANGLE = 10
- local FPS = 0.1
- local canjump=true
- local removing = game.DescendantRemoving
- local Mouse = Player:GetMouse()
- local MAINDISK = nil
- local moveto = nil
- local newpath = false
- local oldpath
- local pathwait
- local usingtool = false
- local Pose = "standing"
- local oldanimate = Figure:FindFirstChild("Animate")
- if oldanimate then oldanimate.Disabled=true Humanoid:ClearAllChildren() end
- local sDied = newSound("rbxasset://sounds/uuhhh.wav",Torso)
- local sFallingDown = newSound("rbxasset://sounds/splat.wav",Torso)
- local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav",Torso)
- local sGettingUp = newSound("rbxasset://sounds/hit.wav",Torso)
- local sJumping = newSound("rbxasset://sounds/button.wav",Torso)
- local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3",Torso)
- sRunning.Looped = true
- function clickmovement(END)
- if usingtool then return end
- if not newpath then
- newpath=true
- END = Mouse.Hit.p
- moveto = createdisk()
- moveto.Position = END
- moveto.Orientation = Vector3.new(0,0,90)
- local path = P:CreatePath()
- path:ComputeAsync(Torso.Position, END)
- local waypoints = path:GetWaypoints()
- if path.Status == Enum.PathStatus.Success then
- for _, waypoint in pairs(waypoints) do
- if waypoint.Action == Enum.PathWaypointAction.Jump then
- Humanoid.Jump = true
- end
- if newpath then
- Humanoid:MoveTo(waypoint.Position)
- Humanoid.MoveToFinished:Wait()
- else
- Humanoid:MoveTo(Torso.Position)
- end
- end
- end
- newpath=false
- moveto:Destroy()
- else
- newpath=false
- if moveto~=nil then
- moveto:Destroy()
- end
- Humanoid:MoveTo(Torso.Position)
- end
- end
- function diskpos()
- if MAINDISK~=nil then
- MAINDISK.CFrame = Mouse.Hit
- MAINDISK.Orientation = Vector3.new(0, 0, 90)
- local TOOL = 0
- for i,v in pairs(Player.Backpack:children()) do
- if v:IsA'HopperBin' and v.Active==true then
- TOOL=TOOL+1
- end
- end
- for i,v in pairs(Player.Character:children()) do
- if v:IsA'Tool' then
- TOOL=TOOL+1
- end
- end
- if TOOL~=0 then
- usingtool=true
- if MAINDISK.Parent~=nil then
- MAINDISK.Transparency=1
- end
- else
- if MAINDISK.Parent~=nil then
- MAINDISK.Transparency=0
- end
- usingtool=false
- end
- end
- end
- function createdisk()
- wait()
- local Disc = Instance.new("Part", Figure)
- if usingtool then
- Disc.Transparency=1
- end
- Disc.Shape = "Cylinder"
- Disc.Size = Vector3.new(0.5, 3.5, 2.5)
- Disc.TopSurface = Enum.SurfaceType.Smooth
- Disc.BottomSurface = Enum.SurfaceType.Smooth
- Disc.Anchored = true
- Disc.CanCollide = false
- Disc.BrickColor = BrickColor.new("Lime green")
- return Disc
- end
- MAINDISK = createdisk()
- local rem = removing:Connect(function(ob)
- if ob==MAINDISK then
- MAINDISK = createdisk()
- end
- end)
- function jumpcooldown(velocity)
- coroutine.resume(coroutine.create(function()
- if canjump then
- local oldpower = Humanoid.JumpPower
- canjump=false
- local GYRO = Instance.new("BodyGyro",Torso)
- GYRO.D = 25
- GYRO.P = 20000
- GYRO.MaxTorque = Vector3.new(0,math.huge,0)
- GYRO.CFrame = CFrame.new(Torso.Position,Torso.CFrame*CFrame.new(0,0,-3).Position)
- while wait() do
- if Pose~="falling" and Pose~="jumping" then
- break
- else
- if not canjump then
- Humanoid.JumpPower=0
- end
- end
- end
- GYRO:Destroy()
- wait(.6)
- Humanoid.JumpPower = oldpower
- canjump=true
- end
- end))
- end
- function moveJump()
- Rightshoulder.MaxVelocity = jumpMaxLimbVelocity
- Leftshoulder.MaxVelocity = jumpMaxLimbVelocity
- Rightshoulder:SetDesiredAngle(3.14)
- Leftshoulder:SetDesiredAngle(-3.14)
- Righthip:SetDesiredAngle(0)
- Lefthip:SetDesiredAngle(0)
- end
- function moveFreeFall()
- Rightshoulder.MaxVelocity = jumpMaxLimbVelocity
- Leftshoulder.MaxVelocity = jumpMaxLimbVelocity
- Rightshoulder:SetDesiredAngle(3.14)
- Leftshoulder:SetDesiredAngle(-3.14)
- Righthip:SetDesiredAngle(0)
- Lefthip:SetDesiredAngle(0)
- end
- function moveclimb(desiredangle,climbangle)
- Leftshoulder.MaxVelocity=jumpMaxLimbVelocity
- Rightshoulder.MaxVelocity=jumpMaxLimbVelocity
- Lefthip:SetDesiredAngle(-desiredangle*6.65)
- Righthip:SetDesiredAngle(-desiredangle*6.65)
- Leftshoulder:SetDesiredAngle(desiredangle*6.5-climbangle)
- Rightshoulder:SetDesiredAngle(desiredangle*6.5+climbangle)
- end
- function moveSit()
- Rightshoulder.MaxVelocity = 0.15
- Leftshoulder.MaxVelocity = 0.15
- Rightshoulder:SetDesiredAngle(3.14 /2)
- Leftshoulder:SetDesiredAngle(-3.14 /2)
- Righthip:SetDesiredAngle(3.14 /2)
- Lefthip:SetDesiredAngle(-3.14 /2)
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- Rightshoulder:SetDesiredAngle(1.57)
- return
- end
- if (toolAnim == "Slash") then
- Rightshoulder.MaxVelocity = 0.2
- Rightshoulder:SetDesiredAngle(0)
- return
- end
- if (toolAnim == "Lunge") then
- Rightshoulder.MaxVelocity = 0.2
- Leftshoulder.MaxVelocity = 0.2
- Righthip.MaxVelocity = 0.2
- Lefthip.MaxVelocity = 0.2
- Rightshoulder:SetDesiredAngle(1.57)
- Leftshoulder:SetDesiredAngle(1.0)
- Righthip:SetDesiredAngle(1.57)
- Lefthip:SetDesiredAngle(1.0)
- return
- end
- end
- function Move(desiredangle,time)
- Torso.CFrame = Torso.CFrame*CFrame.new(0,-0.001,0)
- if Pose=="running" or Pose=="climbing" or Pose=="falling" then
- local anglespeed = 0.2 - walkspeed*0.005
- if anglespeed>0.01 then
- movespeed=anglespeed
- FPS=0.05
- else
- movespeed=0.01
- FPS=0
- end
- if Pose=="climbing" then
- Humanoid:MoveTo(Torso.CFrame*CFrame.new(0,0,-1.5).Position)
- end
- end
- if Pose=="jumping" then
- moveJump()
- return
- end
- if Pose=="falling" then
- moveFreeFall()
- return
- end
- if Pose=="climbing" then
- moveclimb(desiredangle,math.rad(180))
- return
- end
- if Pose=="sitting" then
- moveSit()
- return
- end
- if Pose=="running" then
- ANGLE=9.5
- Lefthip:SetDesiredAngle(-desiredangle*6.65)
- Righthip:SetDesiredAngle(-desiredangle*6.65)
- Leftshoulder:SetDesiredAngle(desiredangle*6.5+desiredangle)
- Rightshoulder:SetDesiredAngle(desiredangle*6.5+desiredangle)
- --Lefthip.DesiredAngle = -desiredangle*6.65+desiredangle
- --Righthip.DesiredAngle = -desiredangle*6.65+desiredangle
- --Rightshoulder.DesiredAngle = desiredangle*6.5+desiredangle
- --Leftshoulder.DesiredAngle = desiredangle*6.5+desiredangle
- if (Rightshoulder.CurrentAngle > 1.5 or Rightshoulder.CurrentAngle < -1.5) then
- Rightshoulder.MaxVelocity = 0.1
- else
- if movespeed>-0.01 then
- Rightshoulder.MaxVelocity = 0.15/2
- Righthip.MaxVelocity = 0.2/4
- else
- Righthip.MaxVelocity = .7
- Rightshoulder.MaxVelocity = .7
- end
- end
- if (Leftshoulder.CurrentAngle > 1.5 or Leftshoulder.CurrentAngle < -1.5) then
- Leftshoulder.MaxVelocity = 0.1
- else
- if movespeed>-0.01 then
- Leftshoulder.MaxVelocity = 0.15/2
- Lefthip.MaxVelocity = 0.2/4
- else
- Lefthip.MaxVelocity = .7
- Leftshoulder.MaxVelocity = .7
- end
- end
- end
- if Pose=="standing" or Pose=="platformstand" then
- if (Rightshoulder.CurrentAngle > 1.5 or Rightshoulder.CurrentAngle < -1.5) then
- Rightshoulder.MaxVelocity = 0.25/2
- end
- if (Leftshoulder.CurrentAngle > 1.5 or Leftshoulder.CurrentAngle < -1.5) then
- Leftshoulder.MaxVelocity = 0.25/2
- end
- ANGLE=10
- movespeed = 1
- Lefthip.DesiredAngle = -desiredangle
- Righthip.DesiredAngle = -desiredangle
- Rightshoulder.DesiredAngle = desiredangle
- Leftshoulder.DesiredAngle = desiredangle
- end
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time+.3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- function onSeated()
- Pose="sitting"
- end
- function onRunning(speed)
- --if Pose=="climbing" then return end
- local Torsovelocity = (Torso.Velocity * Vector3.new(1,0,1)).magnitude
- if speed>0 then
- Pose="running"
- sRunning:play()
- else
- movespeed=1
- Pose="standing"
- sRunning:pause()
- end
- end
- function onDied()
- Pose="died"
- sDied:play()
- end
- function onJumping()
- Pose="jumping"
- sJumping:Play()
- end
- function onClimbing()
- Pose="climbing"
- end
- function onGettingUp()
- Pose="standingup"
- end
- function onFreeFall()
- Pose="falling"
- end
- function onFallingDown()
- Pose="falling"
- end
- function onPlatformStanding()
- Pose="platformstand"
- end
- function onSwimming()
- Pose="swimming"
- end
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- Mouse.Button1Down:Connect(clickmovement)
- --sound functions
- function onState(state, sound)
- if state then
- sound:play()
- else
- sound:pause()
- end
- end
- Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
- Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
- Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
- Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
- while true do
- local _, time = wait(FPS)
- if Figure.Parent~=nil then else
- rem:Disconnect() break
- end
- local jumpVelocity = Torso.Velocity.y
- walkspeed = Humanoid.WalkSpeed
- local angle = math.sin(-tick()/movespeed)/ANGLE
- Move(angle,time)
- if jumpVelocity>5 or jumpVelocity<-5 then
- jumpcooldown(jumpVelocity)
- end
- diskpos()
- end
- ]],owner.Character)
Add Comment
Please, Sign In to add comment