Advertisement
hecknes

sonic

Jun 3rd, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.91 KB | None | 0 0
  1.  
  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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. script.Parent = Player.Character
  7.  
  8. --RemoteEvent for communicating
  9. local Event = Instance.new("RemoteEvent")
  10. Event.Name = "UserInput_Event"
  11.  
  12. --Fake event to make stuff like Mouse.KeyDown work
  13. local function fakeEvent()
  14. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  15. t.connect = t.Connect
  16. return t
  17. end
  18.  
  19. --Creating fake input objects with fake variables
  20. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  21. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24. end}
  25. --Merged 2 functions into one by checking amount of arguments
  26. CAS.UnbindAction = CAS.BindAction
  27.  
  28. --This function will trigger the events that have been :Connect()'ed
  29. local function te(self,ev,...)
  30. local t = m[ev]
  31. if t and t._fakeEvent and t.Function then
  32. t.Function(...)
  33. end
  34. end
  35. m.TrigEvent = te
  36. UIS.TrigEvent = te
  37.  
  38. Event.OnServerEvent:Connect(function(plr,io)
  39. if plr~=Player then return end
  40. if io.isMouse then
  41. m.Target = io.Target
  42. m.Hit = io.Hit
  43. else
  44. local b = io.UserInputState == Enum.UserInputState.Begin
  45. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  46. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  47. end
  48. for _,t in pairs(CAS.Actions) do
  49. for _,k in pairs(t.Keys) do
  50. if k==io.KeyCode then
  51. t.Function(t.Name,io.UserInputState,io)
  52. end
  53. end
  54. end
  55. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  56. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  57. end
  58. end)
  59. Event.Parent = NLS([==[
  60. local Player = game:GetService("Players").LocalPlayer
  61. local Event = script:WaitForChild("UserInput_Event")
  62.  
  63. local UIS = game:GetService("UserInputService")
  64. local input = function(io,a)
  65. if a then return end
  66. --Since InputObject is a client-side instance, we create and pass table instead
  67. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  68. end
  69. UIS.InputBegan:Connect(input)
  70. UIS.InputEnded:Connect(input)
  71.  
  72. local Mouse = Player:GetMouse()
  73. local h,t
  74. --Give the server mouse data 30 times every second, but only if the values changed
  75. --If player is not moving their mouse, client won't fire events
  76. while wait(1/30) do
  77. if h~=Mouse.Hit or t~=Mouse.Target then
  78. h,t=Mouse.Hit,Mouse.Target
  79. Event:FireServer({isMouse=true,Target=t,Hit=h})
  80. end
  81. end]==],Player.Character)
  82. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  83. end
  84.  
  85. char = owner.Character
  86. print("Sonic Forces! Double boost!")
  87. local gui = Instance.new("ScreenGui",owner.PlayerGui)
  88. local text = Instance.new("TextLabel",gui)
  89. text.Position = UDim2.new(0.003, 0,0.781, 0)
  90. text.Size = UDim2.new(0.203, 0,0.211, 0)
  91. text.BackgroundTransparency = 1
  92. text.TextColor3 = Color3.new(1,1,1)
  93. text.TextScaled = true
  94. text.Text = "Speed: 0"
  95. char.Humanoid.Animator:Destroy()
  96. char.Animate:Destroy()
  97. char.HumanoidRootPart.RootJoint.C1 = CFrame.new(0,0,0)
  98. char.Torso["Right Hip"].C1 = CFrame.new(0,0,0)
  99. for i = 0,1 ,0.03 do
  100. char.HumanoidRootPart.RootJoint.C0 = char.HumanoidRootPart.RootJoint.C0:lerp(CFrame.new(0, 0.107334137, -0.173822403, 1, 0, 0, 0, 0.940232992, -0.340532184, 0, 0.340532184, 0.940232992):inverse(),i)
  101. char.Torso["Right Hip"].C0 = char.Torso["Right Hip"].C0:lerp(CFrame.new(0.5, -1.87479305, -0.59992981, 1, 0, 0, 0, 0.916532993, -0.399959058, 0, 0.399958998, 0.916533113),i)
  102. game:GetService("RunService").RenderStepped:wait()
  103. end
  104. char.Humanoid.WalkSpeed = 0
  105. local boost = Instance.new("Sound",char)
  106. boost.SoundId = "rbxassetid://1192337951"
  107. boost.Volume = 4
  108. boost.Looped = true
  109. boost:Play()
  110. coroutine.wrap(function()
  111. while true do
  112. wait(0.01)
  113. if boost.Parent == nil then
  114. boost.Parent = char
  115. end
  116. end
  117. end)()
  118. wait(5)
  119. local boostp = Instance.new("Part",char)
  120. boostp.BrickColor = BrickColor.new("Electric blue")
  121. boostp.Transparency = 0.5
  122. local boostm = Instance.new("FileMesh",boostp)
  123. boostm.MeshId = "http://www.roblox.com/asset/?id=16150864"
  124. boostm.Scale = Vector3.new(5,5,5)
  125. local boostw = Instance.new("Weld",boostp)
  126. boostw.Part0 = boostp
  127. boostw.Part1 = char.Torso
  128. boostw.C0 = CFrame.new(0.00974273682, 0.00136947632, -0.455072403, 0.998052895, -0.024946643, 0.0571669154, 0.0573021285, 0.00473886728, -0.998345733, 0.0246344674, 0.999677718, 0.00615915656)
  129. local booste = Instance.new("Sound",char)
  130. booste.SoundId = "rbxassetid://1295449565"
  131. booste.Looped = true
  132. booste.Volume = 2
  133. booste:Play()
  134. local boost2 = Instance.new("Sound",char)
  135. boost2.Volume = 4
  136. boost2.SoundId = "rbxassetid://1295446488"
  137. boost2:Play()
  138. lhandweld = char.Torso["Left Shoulder"]
  139. rhandweld = char.Torso["Right Shoulder"]
  140. llegweld = char.Torso["Left Hip"]
  141. rlegweld = char.Torso["Right Hip"]
  142. lhandweld.C1 = CFrame.new(0,0,0)
  143. rhandweld.C1 = CFrame.new(0,0,0)
  144. llegweld.C1 = CFrame.new(0,0,0)
  145. rlegweld.C1 = CFrame.new(0,0,0)
  146. local trail = Instance.new("Trail",char)
  147. trail.Color = ColorSequence.new(boostp.BrickColor.Color)
  148. trail.Lifetime = 0.5
  149. local attachment0 = Instance.new("Attachment",char.Head)
  150. attachment0.Name = "TrailAttachment0"
  151. local attachment1 = Instance.new("Attachment",char.HumanoidRootPart)
  152. attachment1.Name = "TrailAttachment1"
  153. trail.Attachment0 = attachment0
  154. trail.Attachment1 = attachment1
  155. local newvel = Instance.new("BodyVelocity")
  156. newvel.Parent = char.Torso
  157. newvel.maxForce = Vector3.new(100000,3000,100000)
  158. newvel.velocity = newvel.Parent.CFrame.lookVector*100
  159. newvel.Name = "SuperRun"
  160. char.Torso.Touched:connect(function(part)
  161. local human = part.Parent:FindFirstChildOfClass("Humanoid")
  162. if human then
  163. human.Parent:BreakJoints()
  164. end
  165. end)
  166. coroutine.wrap(function()
  167. while true do
  168. wait(0.01)
  169. for i = 1,40 do
  170. wait()
  171. newvel.velocity = newvel.Parent.CFrame.lookVector* math.random(100,1000)
  172. text.Text = "Speed: " .. math.random(100,1000)
  173. end
  174. end
  175. end)()
  176. while true do
  177. wait(0.01)
  178. char.Humanoid.WalkSpeed = math.random(100,200)
  179. for i = 0,1 ,0.3 do
  180. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.273401737, 0.445701599, 1, 0, 0, 0, 0.453197539, 0.891410112, 0, -0.891410232, 0.453197569),i)
  181. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.53495121, -0.844882965, 1, 0, 0, 0, 0.534950972, -0.844883084, 0, 0.844883084, 0.534951091),i)
  182. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.313892841, 0.464073181, 1, 0, 0, 0, 0.37221545, 0.928146303, 0, -0.928146362, 0.372215509),i)
  183. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.59347343, 0.804859161, 1, 0, 0, 0, 0.593472898, 0.804853976, 0, -0.804854035, 0.593472958),i)
  184. game:GetService("RunService").RenderStepped:wait()
  185. end
  186. for i = 0,1 ,0.3 do
  187. llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.63476276, 0.772708893, 1, 0, 0, 0, 0.63476181, 0.77270782, 0, -0.77270788, 0.63476187),i)
  188. rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.49659729, -0.867980957, 1, 0, 0, 0, 0.496596336, -0.867981553, 0, 0.867981672, 0.496596336),i)
  189. game:GetService("RunService").RenderStepped:wait()
  190. end
  191. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement