Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- function rayCast(Position, Direction, Range, Ignore)
- return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
- end
- local Player_Size = 1
- function wbtwe(first,second,c0)
- local weld = Instance.new("Weld", first)
- weld.Part0 = first
- weld.Part1 = second
- weld.C0 = second.CFrame:inverse() *second.CFrame *c0
- return weld
- end
- hoodbounce = 1
- lwalk = 1
- rwalk = 1
- walk = 1
- animt = true
- deb = false
- hrw = wbtwe(owner.Character.Torso, owner.Character.HumanoidRootPart, CFrame.new(0, 0, 0))
- law = wbtwe(owner.Character["Left Arm"], owner.Character.Torso, CFrame.new(1.34, 0, 0) *CFrame.Angles(0, 25.1, 0))
- raw = wbtwe(owner.Character["Right Arm"], owner.Character.Torso, CFrame.new(-1.34, 1, 0.8) *CFrame.Angles(-1.5, 0, 0))
- llw = wbtwe(owner.Character["Left Leg"], owner.Character.HumanoidRootPart, CFrame.new(0.45, 2.1, 0) *CFrame.Angles(0, 25.1, 0))
- rlw = wbtwe(owner.Character["Right Leg"], owner.Character.HumanoidRootPart, CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(0, 0, 0))
- hw = wbtwe(owner.Character.Head, owner.Character.Torso, CFrame.new(0, -1.5, 0) *CFrame.Angles(0, 0, 0.2))
- local sound = Instance.new("Sound", owner.Character.Head)
- sound.SoundId = "rbxassetid://1452402780"
- sound.Volume = 1
- sound.Looped = true
- sound:Play()
- local song = Instance.new("Sound", owner.Character.Head)
- song.SoundId = "rbxassetid://1837111398"
- song.Volume = 2
- song.Looped = true
- song:Play()
- local hood = Instance.new("Part", owner.Character.Head)
- hood.CanCollide = false
- hood.Size = Vector3.new(2, 2, 1.8)
- hood.BrickColor = BrickColor.new("Really black")
- local mesh = Instance.new("SpecialMesh", hood)
- mesh.MeshId = "http://www.roblox.com/asset/?id=76062497"
- mesh.Scale = Vector3.new(1.1, 1.1, 1.1)
- owner.Character.Head.face.Texture = "http://www.roblox.com/asset/?id=2099106175"
- hoodw = wbtwe(hood, owner.Character.Head, CFrame.new(0, 0, -0.1))
- anim = coroutine.wrap(function()
- while game:GetService("RunService").Stepped:wait() do
- if animt == true then
- if owner.Character.HumanoidRootPart.Velocity.Magnitude < 1 then
- llw.Part1 = owner.Character.HumanoidRootPart
- rlw.Part1 = owner.Character.HumanoidRootPart
- hoodbounce = hoodbounce +0.1
- hoodw.C0 = hoodw.C0:lerp(owner.Character.Head.CFrame:inverse() *owner.Character.Head.CFrame *CFrame.new(0, 0, -0.1), 0.4)
- hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.5, 0) *CFrame.Angles(math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), 0.2 +math.rad(math.random(-1, 1))), 0.1)
- hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, 1, 0) *CFrame.Angles(math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.34, 0, 0) *CFrame.Angles(math.rad(math.random(-1, 1)), 25.1 +math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.34, 0.8, 0.3) *CFrame.Angles(-2.5 +math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.34, 2.1, 1.2) *CFrame.Angles(1, 25.1, 0), 0.1)
- rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.34, 2.1, 0.8) *CFrame.Angles(0 +math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- end
- if owner.Character.HumanoidRootPart.Velocity.Magnitude > 1 then
- llw.Part1 = owner.Character.HumanoidRootPart
- rlw.Part1 = owner.Character.HumanoidRootPart
- hitfloor, posfloor = rayCast(owner.Character.HumanoidRootPart.Position, CFrame.new(owner.Character.HumanoidRootPart.Position, owner.Character.HumanoidRootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4 * Player_Size, owner.Character)
- if hitfloor then
- hoodbounce = hoodbounce +0.1
- lwalk = lwalk +0.05
- rwalk = rwalk +0.05
- walk = walk +0.1
- hoodw.C0 = hoodw.C0:lerp(owner.Character.Head.CFrame:inverse() *owner.Character.Head.CFrame *CFrame.new(0, math.cos(hoodbounce) *0.1, -0.1), 0.4)
- hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.5 +math.sin(hoodbounce) *0.1, 0) *CFrame.Angles(math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), 0.2, 0.5 +math.cos(hoodbounce) *0.4), 0.1)
- hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, 0, 0) *CFrame.Angles(math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.34, 0, math.sin(-lwalk) *0.7) *CFrame.Angles(math.sin(lwalk) *0.7 +math.rad(math.random(-1, 1)), 25.1 +math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.34, 0, math.sin(-rwalk) *0.7) *CFrame.Angles(math.sin(rwalk) *0.7 +math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.34, 2.1 +math.cos(lwalk) *0.3, math.sin(lwalk) *0.7) *CFrame.Angles(math.sin(lwalk) *0.9, 25.1, 0), 0.1)
- rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.34, 2.1 +math.cos(lwalk) *0.3, math.sin(-lwalk) *0.7) *CFrame.Angles(math.sin(-lwalk) *0.9+math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1)), math.rad(math.random(-1, 1))), 0.1)
- end
- if hitfloor == nil then
- hoodw.C0 = hoodw.C0:lerp(owner.Character.Head.CFrame:inverse() *owner.Character.Head.CFrame *CFrame.new(0, 0, -0.1), 0.4)
- llw.Part1 = owner.Character.Torso
- rlw.Part1 = owner.Character.Torso
- hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.5, 0) *CFrame.Angles(0, 0, 0), 0.05)
- hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, 0, 0) *CFrame.Angles(1.7, 0, 0), 0.05)
- law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.34, 1, 0) *CFrame.Angles(1.5, 25.1, 0), 0.05)
- raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.34, 1, 0) *CFrame.Angles(1.5, 0, 0), 0.05)
- llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, 0)*CFrame.Angles(0, 25.1, 0), 0.05)
- rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.45, 2.1, 0) *CFrame.Angles(0, 0, 0), 0.05)
- end
- end
- end
- end
- end)anim()
- mouse.KeyDown:connect(function(k)
- if k == "k" then
- if deb == false then
- deb = true
- animt = false
- owner.Character.Humanoid.WalkSpeed = 6
- -- Held up
- for i = 0,1,0.1 do
- game:GetService("RunService").Stepped:wait()
- hrw.C0 = hrw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0, 0, 0), 0.1)
- hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.5, 0), 0.1)
- law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.34, 0, 0) *CFrame.Angles(0, 25.1, 0), 0.05)
- raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.34, 0, 0) *CFrame.Angles(0, 0, 0), 0.05)
- llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, 0)*CFrame.Angles(0, 25.1, 0), 0.05)
- rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.45, 2.1, 0) *CFrame.Angles(0, 0, 0), 0.05)
- end
- end
- end
- end
- end)
Add Comment
Please, Sign In to add comment