Advertisement
yoyo74456

Untitled

Sep 7th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.02 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Please run as a server script. Use h/ instead of hl/.") end
  2. InternalData = {}
  3. do
  4. script.Parent = owner.Character
  5. local Event = Instance.new("RemoteEvent")
  6. Event.Name = "UserInput"
  7. local function NewFakeEvent()
  8. local Fake = {fakeEvent=true,Connect=function(self,Func)self.Function=Func end}Fake.connect = Fake.Connect
  9. return Fake
  10. end
  11. local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  12. local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  13. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  14. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  15. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  16. local function TriggerEvent(self,Event,...)
  17. local Trigger = Mouse[Event]
  18. if Trigger and Trigger.fakeEvent and Trigger.Function then
  19. Trigger.Function(...)
  20. end
  21. end
  22. Mouse.TrigEvent = TriggerEvent
  23. UserInputService.TrigEvent = TriggerEvent
  24. Event.OnServerEvent:Connect(function(FiredBy,Input)
  25. if FiredBy.Name ~= owner.Name then end
  26. if Input.MouseEvent then
  27. Mouse.Target = Input.Target
  28. Mouse.Hit = Input.Hit
  29. else
  30. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  31. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  32. return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up")
  33. end
  34. for _,Action in pairs(ContextActionService.Actions) do
  35. for _,Key in pairs(Action.Keys) do
  36. if Key==Input.KeyCode then
  37. Action.Function(Action.Name,Input.UserInputState,Input)
  38. end
  39. end
  40. end
  41. Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  42. UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  43. end
  44. end)
  45. InternalData["Mouse"] = Mouse
  46. InternalData["ContextActionService"] = ContextActionService
  47. InternalData["UserInputService"] = UserInputService
  48. Event.Parent = NLS([[
  49. local Player = owner
  50. local Event = script:WaitForChild("UserInput")
  51. local UserInputService = game:GetService("UserInputService")
  52. local Mouse = Player:GetMouse()
  53. local Input = function(Input,gameProcessedEvent)
  54. if gameProcessedEvent then return end
  55. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  56. end
  57. UserInputService.InputBegan:Connect(Input)
  58. UserInputService.InputEnded:Connect(Input)
  59. local Hit,Target
  60. while wait(1/30) do
  61. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  62. Hit,Target = Mouse.Hit,Mouse.Target
  63. Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  64. end
  65. end
  66. ]],owner.Character)
  67. end
  68. RealGame = game;game = setmetatable({},{
  69. __index = function (self,Index)
  70. local Sandbox = function (Thing)
  71. if Thing:IsA("Player") then
  72. local RealPlayer = Thing
  73. return setmetatable({},{
  74. __index = function (self,Index)
  75. local Type = type(RealPlayer[Index])
  76. if Type == "function" then
  77. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  78. return function (self)
  79. return InternalData["Mouse"]
  80. end
  81. end
  82. return function (self,...)
  83. return RealPlayer[Index](RealPlayer,...)
  84. end
  85. else
  86. if Index == "PlrObj" then
  87. return RealPlayer
  88. end
  89. return RealPlayer[Index]
  90. end
  91. end;
  92. __tostring = function(self)
  93. return RealPlayer.Name
  94. end
  95. })
  96. end
  97. end
  98. if RealGame[Index] then
  99. local Type = type(RealGame[Index])
  100. if Type == "function" then
  101. if Index:lower() == "getservice" or Index:lower() == "service" then
  102. return function (self,Service)
  103. if Service:lower() == "players" then
  104. return setmetatable({},{
  105. __index = function (self2,Index2)
  106. local RealService = RealGame:GetService(Service)
  107. local Type2 = type(Index2)
  108. if Type2 == "function" then
  109. return function (self,...)
  110. return RealService[Index2](RealService,...)
  111. end
  112. else
  113. if Index2:lower() == "localplayer" then
  114. return Sandbox(owner)
  115. end
  116. return RealService[Index2]
  117. end
  118. end;
  119. __tostring = function(self)
  120. return RealGame:GetService(Service).Name
  121. end
  122. })
  123. elseif Service:lower() == "contextactionservice" then
  124. return InternalData["ContextActionService"]
  125. elseif Service:lower() == "contextactionservice" then
  126. return InternalData["UserInputService"]
  127. elseif Service:lower() == "runservice" then
  128. return setmetatable({},{
  129. __index = function(self2,Index2)
  130. local RealService = RealGame:GetService(Service)
  131. local Type2 = type(Index2)
  132. if Type2 == "function" then
  133. return function (self,...)
  134. return RealService[Index2](RealService,...)
  135. end
  136. else
  137. if Index2:lower() == "bindtorenderstep" then
  138. return function (self,Name,Priority,Function)
  139. return RealGame:GetService("RunService").Stepped:Connect(Function)
  140. end
  141. end
  142. if Index2:lower() == "renderstepped" then
  143. return RealService["Stepped"]
  144. end
  145. return RealService[Index2]
  146. end
  147. end
  148. })
  149. else
  150. return RealGame:GetService(Service)
  151. end
  152. end
  153. end
  154. return function (self,...)
  155. return RealGame[Index](RealGame,...)
  156. end
  157. else
  158. if game:GetService(Index) then
  159. return game:GetService(Index)
  160. end
  161. return RealGame[Index]
  162. end
  163. else
  164. return nil
  165. end
  166. end
  167. });Game = game;owner = game:GetService("Players").LocalPlayer;script = {}
  168. --
  169. Player = game:GetService("Players").HANdsum
  170. Char = Player.Character
  171. --
  172. Char.Humanoid.HipHeight = 3
  173. --
  174. local root = Char.HumanoidRootPart
  175. local larm = Char["Left Arm"]
  176. local rarm = Char["Right Arm"]
  177. local lleg = Char["Left Leg"]
  178. local rleg = Char["Right Leg"]
  179. local hed = Char.Head
  180. local torso = Char.Torso
  181.  
  182. newWeld = function(wp0, wp1, wc0x, wc0y, wc0z)
  183. local wld = Instance.new("Weld", wp1)
  184. wld.Part0 = wp0
  185. wld.Part1 = wp1
  186. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  187. end
  188.  
  189. newWeld(torso, larm, -1.5, 0.5, 0)
  190. larm.Weld.C1 = CFrame.new(0.1, 0.6, 0.2) * CFrame.Angles(math.rad(-17,97), math.rad(168.77), math.rad(-11.14))
  191. newWeld(torso, rarm, 1.5, 0.5, 0)
  192. rarm.Weld.C1 = CFrame.new(-0.1, 0.6, 0.2) * CFrame.Angles(math.rad(-17.97), math.rad(191.23), math.rad(11.32))
  193. newWeld(torso, hed, 0, 1.5, 0)
  194. newWeld(torso, lleg, -0.5, -1, 0)
  195. lleg.Weld.C1 = CFrame.new(0, 0.9, 0) * CFrame.Angles(math.rad(-15),math.rad(180),math.rad(0.09))
  196. newWeld(torso, rleg, 0.5, -1, 0)
  197. rleg.Weld.C1 = CFrame.new(0, 0.9, 0) * CFrame.Angles(math.rad(-15),math.rad(180),math.rad(0.09))
  198. newWeld(root, torso, 0, -1, 0)
  199. torso.Weld.C1 = CFrame.new(0, -1, 0)
  200.  
  201. while wait() do
  202. local tweenService = game:GetService("TweenService")
  203.  
  204. local tweenInformation = TweenInfo.new (
  205. 1,
  206. Enum.EasingStyle.Linear,
  207. Enum.EasingDirection.Out,
  208. 0,
  209. false,
  210. 0
  211. )
  212.  
  213. local partProperties = {
  214. HipHeight = 2
  215. }
  216.  
  217. local Down = tweenService:Create(Char.Humanoid,tweenInformation,partProperties)
  218. Down:Play()
  219.  
  220. wait(1)
  221.  
  222. local tweenService = game:GetService("TweenService")
  223.  
  224. local tweenInformation = TweenInfo.new (
  225. 1,
  226. Enum.EasingStyle.Linear,
  227. Enum.EasingDirection.In,
  228. 0,
  229. false,
  230. 0
  231. )
  232.  
  233. local partProperties = {
  234. HipHeight = 3
  235. }
  236.  
  237. local Up = tweenService:Create(Char.Humanoid,tweenInformation,partProperties)
  238. Up:Play()
  239.  
  240. wait(1)
  241. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement