Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. script.Parent = Player.Character
  5.  
  6. --RemoteEvent for communicating
  7. local Event = Instance.new("RemoteEvent")
  8. Event.Name = "UserInput_Event"
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local function fakeEvent()
  12. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  13. t.connect = t.Connect
  14. return t
  15. end
  16.  
  17. --Creating fake input objects with fake variables
  18. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  19. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  20. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  21. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  22. end}
  23. --Merged 2 functions into one by checking amount of arguments
  24. CAS.UnbindAction = CAS.BindAction
  25.  
  26. --This function will trigger the events that have been :Connect()'ed
  27. local function te(self,ev,...)
  28. local t = m[ev]
  29. if t and t._fakeEvent and t.Function then
  30. t.Function(...)
  31. end
  32. end
  33. m.TrigEvent = te
  34. UIS.TrigEvent = te
  35.  
  36. Event.OnServerEvent:Connect(function(plr,io)
  37. if plr~=Player then return end
  38. if io.isMouse then
  39. m.Target = io.Target
  40. m.Hit = io.Hit
  41. else
  42. local b = io.UserInputState == Enum.UserInputState.Begin
  43. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  44. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  45. end
  46. for _,t in pairs(CAS.Actions) do
  47. for _,k in pairs(t.Keys) do
  48. if k==io.KeyCode then
  49. t.Function(t.Name,io.UserInputState,io)
  50. end
  51. end
  52. end
  53. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  54. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  55. end
  56. end)
  57. Event.Parent = NLS([==[
  58. local Player = game:GetService("Players").LocalPlayer
  59. local Event = script:WaitForChild("UserInput_Event")
  60.  
  61. local UIS = game:GetService("UserInputService")
  62. local input = function(io,a)
  63. if a then return end
  64. --Since InputObject is a client-side instance, we create and pass table instead
  65. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  66. end
  67. UIS.InputBegan:Connect(input)
  68. UIS.InputEnded:Connect(input)
  69.  
  70. local Mouse = Player:GetMouse()
  71. local h,t
  72. --Give the server mouse data 30 times every second, but only if the values changed
  73. --If player is not moving their mouse, client won't fire events
  74. while wait(1/30) do
  75. if h~=Mouse.Hit or t~=Mouse.Target then
  76. h,t=Mouse.Hit,Mouse.Target
  77. Event:FireServer({isMouse=true,Target=t,Hit=h})
  78. end
  79. end]==],Player.Character)
  80. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  81. end
  82. local p = owner
  83. repeat wait() until p.Character
  84. wait(2)
  85. local a = -0.1
  86. local imoutta = Instance.new("Sound",p.Character)
  87. imoutta.Volume = 5
  88. imoutta.SoundId = "rbxassetid://880884101"
  89. imoutta:Play()
  90. for i = 1,10 do
  91. wait()
  92. a = a + 0.05
  93. p.Character.Torso["Right Shoulder"].C0 = p.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,a)
  94. end
  95. p.Character.Head.face.Texture = "http://www.roblox.com/asset/?id=134893561"
  96. for i = 1,10 do
  97. wait()
  98. a = a - 0.05
  99. p.Character.Torso["Right Shoulder"].C0 = p.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,a)
  100. end
  101. wait(1)
  102. local h = 1
  103. for i = 1,10 do
  104. wait()
  105. a = a + 0.05
  106. p.Character.Torso["Neck"].C0 = p.Character.Torso["Neck"].C0 * CFrame.Angles(a/6,0,0)
  107. p.Character.Torso["Right Shoulder"].C0 = p.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,-a)
  108. end
  109. for i = 1,10 do
  110. wait()
  111. a = a - 0.05
  112. p.Character.Torso["Neck"].C0 = p.Character.Torso["Neck"].C0 * CFrame.Angles(a/6,0,0)
  113. p.Character.Torso["Right Shoulder"].C0 = p.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,-a)
  114. end
  115. p.Character.Humanoid.Animator:Destroy()
  116. local b = 0.2
  117. for i = 1,50 do
  118. b = b - 0.02
  119. if b <= 0 then
  120. b = 0
  121. end
  122. p.Character.Torso["Right Shoulder"].C0 = p.Character.Torso["Right Shoulder"].C0 * CFrame.Angles(0,0,b*3)
  123. p.Character.Torso["Left Shoulder"].C0 = p.Character.Torso["Left Shoulder"].C0 * CFrame.Angles(0,0,-b*3)
  124. p.Character.Torso["Right Hip"].C0 = p.Character.Torso["Right Hip"].C0 * CFrame.Angles(0,0,-b)
  125. p.Character.Torso["Left Hip"].C0 = p.Character.Torso["Left Hip"].C0 * CFrame.Angles(0,0,b)
  126. wait()
  127. h = h - 0.1
  128. p.Character.Torso.Anchored = true
  129. p.Character.HumanoidRootPart.CFrame = p.Character.HumanoidRootPart.CFrame * CFrame.new(0,h,-1) * CFrame.Angles(-0.02,0,0)
  130. end
  131. p.Character.Humanoid.Health = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement