Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.06 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86. local h,t
  87. --Give the server mouse data every second frame, but only if the values changed
  88. --If player is not moving their mouse, client won't fire events
  89. local HB = game:GetService("RunService").Heartbeat
  90. while true do
  91. if h~=Mouse.Hit or t~=Mouse.Target then
  92. h,t=Mouse.Hit,Mouse.Target
  93. Event:FireServer({isMouse=true,Target=t,Hit=h})
  94. end
  95. --Wait 2 frames
  96. for i=1,2 do
  97. HB:Wait()
  98. end
  99. end]==],script)
  100.  
  101. ----Sandboxed game object that allows the usage of client-side methods and services
  102. --Real game object
  103. local RealGame = game
  104.  
  105. --Metatable for fake service
  106. local FakeService_Metatable = {
  107. __index = function(self,k)
  108. local s = rawget(self,"_RealService")
  109. if s then
  110. return typeof(s[k])=="function"
  111. and function(_,...)return s[k](s,...)end or s[k]
  112. end
  113. end,
  114. __newindex = function(self,k,v)
  115. local s = rawget(self,"_RealService")
  116. if s then s[k]=v end
  117. end
  118. }
  119. local function FakeService(t,RealService)
  120. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  121. return setmetatable(t,FakeService_Metatable)
  122. end
  123.  
  124. --Fake game object
  125. local FakeGame = {
  126. GetService = function(self,s)
  127. return rawget(self,s) or RealGame:GetService(s)
  128. end,
  129. Players = FakeService({
  130. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  131. },"Players"),
  132. UserInputService = FakeService(UIS,"UserInputService"),
  133. ContextActionService = FakeService(CAS,"ContextActionService"),
  134. RunService = FakeService({
  135. _btrs = {},
  136. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  137. BindToRenderStep = function(self,name,_,fun)
  138. self._btrs[name] = self.Heartbeat:Connect(fun)
  139. end,
  140. UnbindFromRenderStep = function(self,name)
  141. self._btrs[name]:Disconnect()
  142. end,
  143. },"RunService")
  144. }
  145. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  146. FakeGame.service = FakeGame.GetService
  147. FakeService(FakeGame,game)
  148. --Changing owner to fake player object to support owner:GetMouse()
  149. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  150. end
  151. -- Double Boost Recreation by Theamazingnater
  152. plr = game.Players.LocalPlayer
  153. repeat wait() until plr.Character
  154. char = plr.Character
  155. mouse = plr:GetMouse()
  156.  
  157.  
  158. wait(1)
  159.  
  160. local neck = Instance.new("Weld",char)
  161. neck.Part0 = char.Torso
  162. neck.Part1 = char.Head
  163. neck.C0 = CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  164. local humanroot = Instance.new("Weld",char)
  165. humanroot.Name = "HumanoidRoot"
  166. humanroot.Part0 = char.HumanoidRootPart
  167. humanroot.Part1 = char.Torso
  168. local rhandclone = game.Players.LocalPlayer.Character.Torso["Right Shoulder"]:Clone()
  169. local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  170. rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  171. rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  172. rhandweld.C0 = CFrame.new(0, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
  173. local lhandclone = game.Players.LocalPlayer.Character.Torso["Left Shoulder"]:Clone()
  174. local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  175. lhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  176. lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
  177. lhandweld.C0 = CFrame.new(0, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
  178. local llegweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  179. llegweld.Part0 = game.Players.LocalPlayer.Character.Torso
  180. llegweld.Part1 = game.Players.LocalPlayer.Character["Left Leg"]
  181. llegweld.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.new(0,-1,0)
  182. local rlegclone = game.Players.LocalPlayer.Character.Torso["Right Hip"]:Clone()
  183. game.Players.LocalPlayer.Character.Torso["Right Hip"]:Remove()
  184. local rlegweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  185. rlegweld.Part0 = game.Players.LocalPlayer.Character.Torso
  186. rlegweld.Part1 = game.Players.LocalPlayer.Character["Right Leg"]
  187. rlegweld.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.new(0,-1,0)
  188.  
  189.  
  190. for i = 0,1 ,0.03 do
  191. humanroot.C0 = humanroot.C0:lerp(CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.861433148, -0.507871091, 0, 0.507871091, 0.861433148):inverse(),i)
  192. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.0847580433, -0.504649997, 1, 0, 0, 0, 0.826165259, -0.563427925, 0, 0.563427925, 0.826165259),i)
  193. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.9787972, -0.643271148, 0, 0, -1, -0.519508898, 0.854465187, 0, 0.854465187, 0.519508898, 0),i)
  194. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.0881803036, -0.315132141, 1, 0, 0, 0, 0.840211272, -0.542259157, 0, 0.542259157, 0.840211272),i)
  195. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.95825088, -0.666816115, 0, 0, 1, 0.529378891, 0.848385572, 0, -0.848385572, 0.529378891, 0),i)
  196. neck.C0 = neck.C0:lerp(CFrame.new(0, 1.39824653, 0.172113657, 1, 0, 0, 0, 0.860818028, -0.50891304, 0, 0.50891304, 0.860818028),i)
  197. game:GetService("RunService").RenderStepped:wait()
  198. end
  199. local SCREENGUI = Instance.new("ScreenGui",plr.PlayerGui)
  200. local IMAGE = Instance.new("ImageButton",SCREENGUI)
  201. IMAGE.Image = "rbxassetid://39637251"
  202. IMAGE.Size = UDim2.new(0.228, 0,0.154, 0)
  203. IMAGE.Position = UDim2.new(0.368, 0,0.534, 0)
  204. IMAGE.BackgroundTransparency = 1
  205. IMAGE.BorderSizePixel = 0
  206. SpinDashCharge = Instance.new("Sound",char)
  207. SpinDashCharge.SoundId = "rbxassetid://301022165"
  208. SpinDashCharge.Volume = 4
  209. Boost = Instance.new("Sound",char)
  210. Boost.SoundId = "rbxassetid://2698534079"
  211. Boost.Volume = 6
  212. Boost.Looped = true
  213. Boost:Play()
  214. Charge = 0
  215. char.Humanoid.JumpPower = 0
  216. Pressed = false
  217. function ChargeBoost()
  218. Charge = Charge + 5
  219. SpinDashCharge:Play()
  220. end
  221. game:GetService("UserInputService").InputBegan:Connect(function(key)
  222. if key.UserInputType == Enum.UserInputType.Keyboard then
  223. if key.KeyCode == Enum.KeyCode.Space and SCREENGUI.Parent ~= nil then
  224. ChargeBoost()
  225. Pressed = true
  226. end
  227. end
  228. end)
  229. wait(5)
  230. SCREENGUI.Parent = nil
  231. char.Humanoid.WalkSpeed = 1 + Charge
  232. char.Humanoid.JumpPower = 50
  233. BoostColor = BrickColor.new("Pink")
  234. if Pressed == false then
  235. char.Humanoid.WalkSpeed = 150
  236. end
  237.  
  238. local trail = Instance.new("Trail",char)
  239. trail.Attachment0 = char.Head.FaceCenterAttachment
  240. trail.Attachment1 = char.HumanoidRootPart.RootAttachment
  241. trail.Color = ColorSequence.new(BoostColor.Color)
  242. trail.MaxLength = 0
  243. trail.Lifetime = 0.2
  244.  
  245. local pose = "Standing"
  246.  
  247. char.Torso.Touched:connect(function(part)
  248. local hum = part.Parent:FindFirstChildOfClass("Humanoid")
  249. if hum and pose == "Walking" then
  250. hum.Health = 0
  251. else
  252. hum.Health = 100
  253. end
  254. end)
  255. local chara = workspace:WaitForChild(plr.Name)
  256. local human = chara.Humanoid
  257.  
  258. local speed = 0
  259.  
  260. human.Running:connect(function(s)
  261. speed = s
  262. end)
  263. cananimate = true
  264. local update = game:GetService("RunService")
  265. update.RenderStepped:connect(function()
  266. local ray = Ray.new(chara.Torso.Position, (chara.Torso.Position - Vector3.new(0,9999999,0)).unit * 300)
  267. local p, position = game.Workspace:FindPartOnRay(ray, char, true, false)
  268. local dis = (chara.Torso.Position - position).magnitude
  269. if dis > 3.8 and chara.Torso.Velocity.Y > 0 then
  270. pose = "Jumping"
  271. end
  272. if dis> 3.8 and chara.Torso.Velocity.Y < 0 then
  273. pose = "Falling"
  274. end
  275. if dis < 3.8 and speed == 0 then
  276. pose = "Standing"
  277. end
  278. if dis < 3.8 and speed > 0 then
  279. pose = "Walking"
  280. end
  281. end)
  282. while true do
  283. wait()
  284. if pose == "Standing" and cananimate then
  285. for i = 0,1 ,0.03 do
  286. humanroot.C0 = humanroot.C0:lerp(CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.861433148, -0.507871091, 0, 0.507871091, 0.861433148):inverse(),i)
  287. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.0847580433, -0.504649997, 1, 0, 0, 0, 0.826165259, -0.563427925, 0, 0.563427925, 0.826165259),i)
  288. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.9787972, -0.643271148, 0, 0, -1, -0.519508898, 0.854465187, 0, 0.854465187, 0.519508898, 0),i)
  289. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.0881803036, -0.315132141, 1, 0, 0, 0, 0.840211272, -0.542259157, 0, 0.542259157, 0.840211272),i)
  290. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.95825088, -0.666816115, 0, 0, 1, 0.529378891, 0.848385572, 0, -0.848385572, 0.529378891, 0),i)
  291. neck.C0 = neck.C0:lerp(CFrame.new(0, 1.39824653, 0.172113657, 1, 0, 0, 0, 0.860818028, -0.50891304, 0, 0.50891304, 0.860818028),i)
  292. game:GetService("RunService").RenderStepped:wait()
  293. end
  294. end
  295. if pose == "Walking" and cananimate then
  296. for i = 0,1 , 0.3 do
  297. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.49999845, 0.0116631985, 0.62646699, 1.00000012, 3.50177288e-07, -2.71806493e-06, 2.0340085e-06, 0.568486691, 0.822692573, 1.83284283e-06, -0.822692692, 0.568486571),i)
  298. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.50001049, -1.33467507, -1.34572363, 1.00135803e-05, -5.93066216e-06, 1.00000012, 0.95380795, 0.300417304, -7.76350498e-06, -0.300417483, 0.95380795, 8.65757465e-06),i)
  299. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -2.06321907, 0.382456064, 1.89989805e-07, 2.23517418e-07, -1.00000012, 0.324321806, 0.945946872, 2.71946192e-07, 0.945946872, -0.324321896, 1.11758709e-07),i)
  300. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.50000167, 0.160489321, 0.409729481, 1.00000012, 3.7252903e-07, -2.71759927e-06, 2.0340085e-06, 0.565193176, 0.824958682, 1.83284283e-06, -0.824958742, 0.565193117),i)
  301. game:GetService("RunService").RenderStepped:wait()
  302. end
  303. for i = 0,1 , 0.3 do
  304. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.500000715, -1.4970336, -1.30027473, 2.85357237e-06, -1.40443444e-06, -1.00000012, -0.956139505, 0.292911917, -3.14414501e-06, 0.292912006, 0.956139505, -4.991889e-07),i)
  305. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.499979883, -1.99265182, 0.346698284, 1.71288848e-05, 6.40004873e-06, 1.00000012, -0.34762764, 0.93763268, -4.09781933e-08, -0.937632799, -0.34762764, 1.82762742e-05),i)
  306. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.49999845, 0.0116631985, 0.62646699, 1.00000012, 3.50177288e-07, -2.71806493e-06, 2.0340085e-06, 0.568486691, 0.822692573, 1.83284283e-06, -0.822692692, 0.568486571),i)
  307. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.50000167, 0.160489321, 0.409729481, 1.00000012, 3.7252903e-07, -2.71759927e-06, 2.0340085e-06, 0.565193176, 0.824958682, 1.83284283e-06, -0.824958742, 0.565193117),i)
  308. end
  309. end
  310. if pose == "Jumping" and cananimate then
  311. for i = 0,1 , 0.05 do
  312. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.999999285, 0.000862598419, 1, 0, 0, 0, -0.99999845, 0.00172528333, 0, -0.00172528345, -0.99999851),i)
  313. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.999960184, -0.00631046295, 1, 0, 0, 0, -0.999920309, -0.0126213925, 0, 0.0126213934, -0.999920368),i)
  314. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
  315. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
  316. update.RenderStepped:wait()
  317. end
  318. end
  319. if pose == "Falling" and cananimate then
  320. for i = 0,1 , 0.05 do
  321. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.999999285, 0.000862598419, 1, 0, 0, 0, -0.99999845, 0.00172528333, 0, -0.00172528345, -0.99999851),i)
  322. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.999960184, -0.00631046295, 1, 0, 0, 0, -0.999920309, -0.0126213925, 0, 0.0126213934, -0.999920368),i)
  323. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
  324. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
  325. update.RenderStepped:wait()
  326. end
  327. end
  328. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement