megaluxe

double boost

Aug 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.25 KB | None | 0 0
  1. --TODO: add comments or something idk
  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 = owner
  4. local Mouse,mouse,UserInputService,ContextActionService
  5. do
  6. script.Parent = Player.Character
  7. local CAS = {Actions={}}
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10. Event.Parent = Player.Character
  11. local fakeEvent = function()
  12. local t = {_fakeEvent=true}
  13. t.Connect = function(self,f)self.Function=f end
  14. t.connect = t.Connect
  15. return t
  16. end
  17. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  18. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  19. function CAS:BindAction(name,fun,touch,...)
  20. CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  21. end
  22. function CAS:UnbindAction(name)
  23. CAS.Actions[name] = nil
  24. end
  25. local function te(self,ev,...)
  26. local t = m[ev]
  27. if t and t._fakeEvent and t.Function then
  28. t.Function(...)
  29. end
  30. end
  31. m.TrigEvent = te
  32. UIS.TrigEvent = te
  33. Event.OnServerEvent:Connect(function(plr,io)
  34. if plr~=Player then return end
  35. if io.isMouse then
  36. m.Target = io.Target
  37. m.Hit = io.Hit
  38. elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  39. if io.UserInputState == Enum.UserInputState.Begin then
  40. m:TrigEvent("Button1Down")
  41. else
  42. m:TrigEvent("Button1Up")
  43. end
  44. else
  45. for n,t in pairs(CAS.Actions) do
  46. for _,k in pairs(t.Keys) do
  47. if k==io.KeyCode then
  48. t.Function(t.Name,io.UserInputState,io)
  49. end
  50. end
  51. end
  52. if io.UserInputState == Enum.UserInputState.Begin then
  53. m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
  54. UIS:TrigEvent("InputBegan",io,false)
  55. else
  56. m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
  57. UIS:TrigEvent("InputEnded",io,false)
  58. end
  59. end
  60. end)
  61. NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63.  
  64. local Char = Player.Character
  65. local Event = Char:WaitForChild("UserInput_Event")
  66.  
  67. local UIS = game:GetService("UserInputService")
  68.  
  69. local input = function(io,a)
  70. if a then return end
  71. local io = {KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
  72. Event:FireServer(io)
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76. local Changed = false
  77. local Mouse = Player:GetMouse()
  78. local h,t = Mouse.Hit,Mouse.Target
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. Event:FireServer({isMouse=true,Target=Mouse.Target,Hit=Mouse.Hit})
  82. h,t=Mouse.Hit,Mouse.Target
  83. end
  84. end
  85. ]==],Player.Character)
  86. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  87. end
  88. --<Start>--
  89. wait(1/60)
  90. char = owner.Character
  91. print("Sonic Forces! Double boost!")
  92. local gui = Instance.new("ScreenGui",owner.PlayerGui)
  93. local text = Instance.new("TextLabel",gui)
  94. text.Position = UDim2.new(0.003, 0,0.781, 0)
  95. text.Size = UDim2.new(0.203, 0,0.211, 0)
  96. text.BackgroundTransparency = 1
  97. text.TextColor3 = Color3.new(1,1,1)
  98. text.TextScaled = true
  99. text.Text = "Speed: 0"
  100. char.Humanoid.Animator:Destroy()
  101. char.Animate:Destroy()
  102. char.HumanoidRootPart.RootJoint.C1 = CFrame.new(0,0,0)
  103. char.Torso["Right Hip"].C1 = CFrame.new(0,0,0)
  104. for i = 0,1 ,0.03 do
  105. 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)
  106. 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)
  107. wait()
  108. end
  109. char.Humanoid.WalkSpeed = 0
  110. local boost = Instance.new("Sound",char)
  111. boost.SoundId = "rbxassetid://1034903243"
  112. boost.Volume = 4
  113. boost.Looped = true
  114. boost:Play()
  115. coroutine.wrap(function()
  116. while true do
  117. wait(0.01)
  118. if boost.Parent == nil then
  119. boost.Parent = char
  120. end
  121. end
  122. end)()
  123. wait(5)
  124. local boostp = Instance.new("Part",char)
  125. boostp.BrickColor = BrickColor.new("Electric blue")
  126. boostp.Transparency = 0.5
  127. local boostm = Instance.new("FileMesh",boostp)
  128. boostm.MeshId = "http://www.roblox.com/asset/?id=16150864"
  129. boostm.Scale = Vector3.new(5,5,5)
  130. local boostw = Instance.new("Weld",boostp)
  131. boostw.Part0 = boostp
  132. boostw.Part1 = char.Torso
  133. 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)
  134. local booste = Instance.new("Sound",char)
  135. booste.SoundId = "rbxassetid://1295449565"
  136. booste.Looped = true
  137. booste.Volume = 2
  138. booste:Play()
  139. local boost2 = Instance.new("Sound",char)
  140. boost2.Volume = 4
  141. boost2.SoundId = "rbxassetid://1295446488"
  142. boost2:Play()
  143. lhandweld = char.Torso["Left Shoulder"]
  144. rhandweld = char.Torso["Right Shoulder"]
  145. llegweld = char.Torso["Left Hip"]
  146. rlegweld = char.Torso["Right Hip"]
  147. lhandweld.C1 = CFrame.new(0,0,0)
  148. rhandweld.C1 = CFrame.new(0,0,0)
  149. llegweld.C1 = CFrame.new(0,0,0)
  150. rlegweld.C1 = CFrame.new(0,0,0)
  151. local trail = Instance.new("Trail",char)
  152. trail.Color = ColorSequence.new(boostp.BrickColor.Color)
  153. trail.Lifetime = 0.5
  154. local attachment0 = Instance.new("Attachment",char.Head)
  155. attachment0.Name = "TrailAttachment0"
  156. local attachment1 = Instance.new("Attachment",char.HumanoidRootPart)
  157. attachment1.Name = "TrailAttachment1"
  158. trail.Attachment0 = attachment0
  159. trail.Attachment1 = attachment1
  160. local newvel = Instance.new("BodyVelocity")
  161. newvel.Parent = char.Torso
  162. newvel.maxForce = Vector3.new(100000,3000,100000)
  163. newvel.velocity = newvel.Parent.CFrame.lookVector*100
  164. newvel.Name = "SuperRun"
  165. char.Torso.Touched:connect(function(part)
  166. local human = part.Parent:FindFirstChildOfClass("Humanoid")
  167. if human then
  168. human.Parent:BreakJoints()
  169. end
  170. end)
  171. coroutine.wrap(function()
  172. while true do
  173. wait(0.01)
  174. for i = 1,40 do
  175. wait()
  176. newvel.velocity = newvel.Parent.CFrame.lookVector* math.random(100,1000)
  177. text.Text = "Speed: " .. math.random(100,1000)
  178. end
  179. end
  180. end)()
  181. while true do
  182. wait(0.01)
  183. char.Humanoid.WalkSpeed = math.random(100,200)
  184. for i = 0,1 ,0.3 do
  185. 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)
  186. 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)
  187. 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)
  188. 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)
  189. wait()
  190. end
  191. for i = 0,1 ,0.3 do
  192. 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)
  193. 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)
  194. wait()
  195. end
  196. end
Add Comment
Please, Sign In to add comment