Advertisement
DogeLiker

sonic runner (FE) (original)

Aug 3rd, 2018
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.25 KB | None | 0 0
  1. -- [ SANIIIC HES ON DA RAWN ] --
  2. wait()
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,game,owner = owner,game
  6. local RealPlayer = Player
  7. do
  8. print("FE Compatibility code by Mokiros")
  9. local rp = RealPlayer
  10. script.Parent = rp.Character
  11.  
  12. --RemoteEvent for communicating
  13. local Event = Instance.new("RemoteEvent")
  14. Event.Name = "UserInput_Event"
  15.  
  16. --Fake event to make stuff like Mouse.KeyDown work
  17. local function fakeEvent()
  18. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  19. t.connect = t.Connect
  20. return t
  21. end
  22.  
  23. --Creating fake input objects with fake variables
  24. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  25. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  26. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  27. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  28. end}
  29. --Merged 2 functions into one by checking amount of arguments
  30. CAS.UnbindAction = CAS.BindAction
  31.  
  32. --This function will trigger the events that have been :Connect()'ed
  33. local function te(self,ev,...)
  34. local t = m[ev]
  35. if t and t._fakeEvent then
  36. for _,f in pairs(t.Functions) do
  37. f(...)
  38. end
  39. end
  40. end
  41. m.TrigEvent = te
  42. UIS.TrigEvent = te
  43.  
  44. Event.OnServerEvent:Connect(function(plr,io)
  45. if plr~=rp then return end
  46. m.Target = io.Target
  47. m.Hit = io.Hit
  48. if not io.isMouse then
  49. local b = io.UserInputState == Enum.UserInputState.Begin
  50. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  51. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67.  
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77.  
  78. local h,t
  79. --Give the server mouse data 30 times every second, but only if the values changed
  80. --If player is not moving their mouse, client won't fire events
  81. while wait(1/30) do
  82. if h~=Mouse.Hit or t~=Mouse.Target then
  83. h,t=Mouse.Hit,Mouse.Target
  84. Event:FireServer({isMouse=true,Target=t,Hit=h})
  85. end
  86. end]==],Player.Character)
  87.  
  88. ----Sandboxed game object that allows the usage of client-side methods and services
  89. --Real game object
  90. local _rg = game
  91.  
  92. --Metatable for fake service
  93. local fsmt = {
  94. __index = function(self,k)
  95. local s = rawget(self,"_RealService")
  96. if s then return s[k] end
  97. end,
  98. __newindex = function(self,k,v)
  99. local s = rawget(self,"_RealService")
  100. if s then s[k]=v end
  101. end,
  102. __call = function(self,...)
  103. local s = rawget(self,"_RealService")
  104. if s then return s(...) end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return self[s]
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. }
  123. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  124. g.service = g.GetService
  125.  
  126. g.RunService = FakeService({
  127. RenderStepped = _rg:GetService("RunService").Heartbeat,
  128. BindToRenderStep = function(self,name,_,fun)
  129. self._btrs[name] = self.Heartbeat:Connect(fun)
  130. end,
  131. UnbindFromRenderStep = function(self,name)
  132. self._btrs[name]:Disconnect()
  133. end,
  134. },"RunService")
  135.  
  136. setmetatable(g,{
  137. __index=function(self,s)
  138. return _rg:GetService(s) or typeof(_rg[s])=="function"
  139. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  140. end,
  141. __newindex = fsmt.__newindex,
  142. __call = fsmt.__call
  143. })
  144. --Changing owner to fake player object to support owner:GetMouse()
  145. game,owner = g,g.Players.LocalPlayer
  146. end
  147.  
  148. thing = 0
  149. LoudVolume = false
  150. Submerged = false
  151. Music = true
  152. script.Name = "SANIIIIC"
  153. Player = owner
  154. c = game.Players.LocalPlayer.Character
  155. Head = c.Head
  156. Humanoid = c.Humanoid
  157. anim = c.Humanoid.Animator
  158. rage = false
  159. p = game.Players.LocalPlayer
  160. Music = false
  161. anim = Humanoid.Animator
  162. local Effects = {}
  163. attack = false
  164. local attacking = false
  165. vt = Vector3.new
  166. bc = BrickColor.new
  167. br = BrickColor.random
  168. it = Instance.new
  169. cf = CFrame.new
  170. euler = CFrame.fromEulerAnglesXYZ
  171. angles = CFrame.Angles
  172. matr = math.random
  173. mouse = Player:GetMouse()
  174.  
  175. RSC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  176. RSC1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  177. LSC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  178. LSC1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  179. RHC0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  180. RHC1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  181. LHC0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  182. LHC1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  183. NC0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  184. NC1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  185. RJC0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  186. RJC1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  187. RS = c.Torso:FindFirstChild("Right Shoulder")
  188. LS = c.Torso:FindFirstChild("Left Shoulder")
  189. RH = c.Torso:FindFirstChild("Right Hip")
  190. LH = c.Torso:FindFirstChild("Left Hip")
  191. RJ = c.HumanoidRootPart:FindFirstChild("RootJoint")
  192. N = c.Torso:FindFirstChild("Neck")
  193. cf = CFrame.new
  194. ang = CFrame.Angles
  195. rd = math.rad
  196. rd2 = math.random
  197.  
  198. --[[mainShirt = c.Shirt
  199. mainPants = c.Pants
  200. mainBColors = c["Body Colors"]
  201. mainShirt.ShirtTemplate = "rbxassetid://769869277"
  202. mainPants.PantsTemplate = "rbxassetid://805486769"
  203. mainBColors.HeadColor = BrickColor.new("Pastel brown")
  204. mainBColors.LeftArmColor = BrickColor.new("Pastel brown")
  205. mainBColors.LeftLegColor = BrickColor.new("Pastel brown")
  206. mainBColors.RightArmColor = BrickColor.new("Pastel brown")
  207. mainBColors.RightLegColor = BrickColor.new("Pastel brown")
  208. mainBColors.TorsoColor = BrickColor.new("Pastel brown")]]
  209. function swait(num)
  210. if num==0 or num==nil then
  211. game:service'RunService'.Heartbeat:wait(0)
  212. else
  213. for i=0,num do
  214. game:service'RunService'.Heartbeat:wait(0)
  215. end
  216. end
  217. end
  218.  
  219. function lerpz(joint, prop, cfrmz, alp)
  220. joint[prop] = joint[prop]:lerp(cfrmz, alp)
  221. end
  222. function resetlerp()
  223. RJ.C0 = RJC0
  224. RJ.C1 = RJC1
  225. N.C0 = NC0
  226. N.C1 = NC1
  227. RS.C0 = RSC0
  228. RS.C1 = RSC1
  229. LS.C0 = LSC0
  230. LS.C1 = LSC1
  231. RH.C0 = RHC0
  232. RH.C1 = RHC1
  233. LH.C0 = LHC0
  234. LH.C1 = LHC1
  235. end
  236.  
  237. local S2 = Instance.new("Sound",c.HumanoidRootPart)S2.SoundId = "rbxassetid://1246460167" S2.Volume = 0 S2.PlaybackSpeed = 0 S2.Looped = true S2:Play()
  238. c.Head.face:remove()
  239.  
  240. local ColorArray = {ColorSequenceKeypoint.new(0, Color3.new(0/255,170/255,255/255)),ColorSequenceKeypoint.new(1, Color3.new(0/255,170/255,255/255))}
  241. local att1 = Instance.new("Attachment", c["Right Leg"])
  242. att1.Name = "att1"
  243. att1.Position = Vector3.new(0.5, 1, 0.5)
  244. local att2 = Instance.new("Attachment", c["Right Leg"])
  245. att2.Name = "att2"
  246. att2.Position = Vector3.new(-0.5, 1, 0.5)
  247. local att3 = Instance.new("Attachment", c["Right Leg"])
  248. att3.Name = "att3"
  249. att3.Position = Vector3.new(0.5, -1, 0.5)
  250. local att4 = Instance.new("Attachment", c["Right Leg"])
  251. att4.Name = "att4"
  252. att4.Position = Vector3.new(-0.5, -1, 0.5)
  253.  
  254. local attt1 = Instance.new("Attachment", c["Left Leg"])
  255. attt1.Name = "att1"
  256. attt1.Position = Vector3.new(0.5, 1, 0.5)
  257. local attt2 = Instance.new("Attachment", c["Left Leg"])
  258. attt2.Name = "att2"
  259. attt2.Position = Vector3.new(-0.5, 1, 0.5)
  260. local attt3 = Instance.new("Attachment", c["Left Leg"])
  261. attt3.Name = "att3"
  262. attt3.Position = Vector3.new(0.5, -1, 0.5)
  263. local attt4 = Instance.new("Attachment", c["Left Leg"])
  264. attt4.Name = "att4"
  265. attt4.Position = Vector3.new(-0.5, -1, 0.5)
  266.  
  267. local trailtop1 = Instance.new("Trail", c["Right Leg"])
  268. trailtop1.Enabled = true
  269. trailtop1.Texture = "rbxassetid://16607923"
  270. trailtop1.Name = "toptrail"
  271. trailtop1.MinLength = 0
  272. trailtop1.Lifetime = 0.1
  273.  
  274. trailtop1.Color = ColorSequence.new(ColorArray)
  275.  
  276. trailtop1.Attachment0 = att1
  277. trailtop1.Attachment1 = att2
  278. trailtop1.Transparency = NumberSequence.new({
  279. NumberSequenceKeypoint.new(0, 0.5, 0),
  280. NumberSequenceKeypoint.new(1, 1, 0)
  281. })
  282.  
  283. local trailbot1 = Instance.new("Trail", c["Right Leg"])
  284. trailbot1.Enabled = true
  285. trailbot1.Texture = "rbxassetid://16607923"
  286. trailbot1.Name = "bottrail"
  287. trailbot1.MinLength = 0
  288. trailbot1.Lifetime = 0.1
  289.  
  290. trailbot1.Color = ColorSequence.new(ColorArray)
  291.  
  292. trailbot1.Attachment0 = att3
  293. trailbot1.Attachment1 = att4
  294. trailbot1.Transparency = NumberSequence.new({
  295. NumberSequenceKeypoint.new(0, 0.5, 0),
  296. NumberSequenceKeypoint.new(1, 1, 0)
  297. })
  298.  
  299. local trailside1 = Instance.new("Trail", c["Right Leg"])
  300. trailside1.Enabled = true
  301. trailside1.Texture = "rbxassetid://16607923"
  302. trailside1.Name = "sidetrail1"
  303. trailside1.MinLength = 0
  304. trailside1.Lifetime = 0.1
  305.  
  306. trailside1.Color = ColorSequence.new(ColorArray)
  307.  
  308. trailside1.Attachment0 = att1
  309. trailside1.Attachment1 = att3
  310. trailside1.Transparency = NumberSequence.new({
  311. NumberSequenceKeypoint.new(0, 0.5, 0),
  312. NumberSequenceKeypoint.new(1, 1, 0)
  313. })
  314.  
  315. local trailside2 = Instance.new("Trail", c["Right Leg"])
  316. trailside2.Enabled = true
  317. trailside2.Texture = "rbxassetid://16607923"
  318. trailside2.Name = "sidetrail2"
  319. trailside2.MinLength = 0
  320. trailside2.Lifetime = 0.1
  321. spawn(function()
  322. while true do wait()
  323. trailside2.Color = ColorSequence.new(ColorArray)
  324. end
  325. end)
  326. trailside2.Attachment0 = att2
  327. trailside2.Attachment1 = att4
  328. trailside2.Transparency = NumberSequence.new({
  329. NumberSequenceKeypoint.new(0, 0.5, 0),
  330. NumberSequenceKeypoint.new(1, 1, 0)
  331. })
  332.  
  333.  
  334. local trailtop12 = Instance.new("Trail", c["Left Leg"])
  335. trailtop12.Enabled = true
  336. trailtop12.Texture = "rbxassetid://16607923"
  337. trailtop12.Name = "toptrail"
  338. trailtop12.MinLength = 0
  339. trailtop12.Lifetime = 0.1
  340. spawn(function()
  341. while true do wait()
  342. trailtop12.Color = ColorSequence.new(ColorArray)
  343. end
  344. end)
  345. trailtop12.Attachment0 = attt1
  346. trailtop12.Attachment1 = attt2
  347. trailtop12.Transparency = NumberSequence.new({
  348. NumberSequenceKeypoint.new(0, 0.5, 0),
  349. NumberSequenceKeypoint.new(1, 1, 0)
  350. })
  351.  
  352. local trailbot2 = Instance.new("Trail", c["Left Leg"])
  353. trailbot2.Enabled = true
  354. trailbot2.Texture = "rbxassetid://16607923"
  355. trailbot2.Name = "bottrail"
  356. trailbot2.MinLength = 0
  357. trailbot2.Lifetime = 0.1
  358.  
  359. trailbot2.Color = ColorSequence.new(ColorArray)
  360.  
  361. trailbot2.Attachment0 = attt3
  362. trailbot2.Attachment1 = attt4
  363. trailbot2.Transparency = NumberSequence.new({
  364. NumberSequenceKeypoint.new(0, 0.5, 0),
  365. NumberSequenceKeypoint.new(1, 1, 0)
  366. })
  367.  
  368. local trailside12 = Instance.new("Trail", c["Left Leg"])
  369. trailside12.Enabled = true
  370. trailside12.Texture = "rbxassetid://16607923"
  371. trailside12.Name = "sidetrail1"
  372. trailside12.MinLength = 0
  373. trailside12.Lifetime = 0.1
  374.  
  375. trailside12.Color = ColorSequence.new(ColorArray)
  376.  
  377. trailside12.Attachment0 = attt1
  378. trailside12.Attachment1 = attt3
  379. trailside12.Transparency = NumberSequence.new({
  380. NumberSequenceKeypoint.new(0, 0.5, 0),
  381. NumberSequenceKeypoint.new(1, 1, 0)
  382. })
  383.  
  384. local trailside22 = Instance.new("Trail", c["Left Leg"])
  385. trailside22.Enabled = true
  386. trailside22.Texture = "rbxassetid://16607923"
  387. trailside22.Name = "sidetrail2"
  388. trailside22.MinLength = 0
  389. trailside22.Lifetime = 0.1
  390.  
  391. trailside22.Color = ColorSequence.new(ColorArray)
  392.  
  393. trailside22.Attachment0 = attt2
  394. trailside22.Attachment1 = attt4
  395. trailside22.Transparency = NumberSequence.new({
  396. NumberSequenceKeypoint.new(0, 0.5, 0),
  397. NumberSequenceKeypoint.new(1, 1, 0)
  398. })
  399.  
  400.  
  401. local att1 = Instance.new("Attachment", c["Right Arm"])
  402. att1.Name = "att1"
  403. att1.Position = Vector3.new(0.5, 1, 0.5)
  404. local att2 = Instance.new("Attachment", c["Right Arm"])
  405. att2.Name = "att2"
  406. att2.Position = Vector3.new(-0.5, 1, 0.5)
  407. local att3 = Instance.new("Attachment", c["Right Arm"])
  408. att3.Name = "att3"
  409. att3.Position = Vector3.new(0.5, -1, 0.5)
  410. local att4 = Instance.new("Attachment", c["Right Arm"])
  411. att4.Name = "att4"
  412. att4.Position = Vector3.new(-0.5, -1, 0.5)
  413.  
  414. local attt1 = Instance.new("Attachment", c["Left Arm"])
  415. attt1.Name = "att1"
  416. attt1.Position = Vector3.new(0.5, 1, 0.5)
  417. local attt2 = Instance.new("Attachment", c["Left Arm"])
  418. attt2.Name = "att2"
  419. attt2.Position = Vector3.new(-0.5, 1, 0.5)
  420. local attt3 = Instance.new("Attachment", c["Left Arm"])
  421. attt3.Name = "att3"
  422. attt3.Position = Vector3.new(0.5, -1, 0.5)
  423. local attt4 = Instance.new("Attachment", c["Left Arm"])
  424. attt4.Name = "att4"
  425. attt4.Position = Vector3.new(-0.5, -1, 0.5)
  426.  
  427. local trailtop1 = Instance.new("Trail", c["Right Arm"])
  428. trailtop1.Enabled = true
  429. trailtop1.Texture = "rbxassetid://16607923"
  430. trailtop1.Name = "toptrail"
  431. trailtop1.MinLength = 0
  432. trailtop1.Lifetime = 0.1
  433.  
  434. trailtop1.Color = ColorSequence.new(ColorArray)
  435.  
  436. trailtop1.Attachment0 = att1
  437. trailtop1.Attachment1 = att2
  438. trailtop1.Transparency = NumberSequence.new({
  439. NumberSequenceKeypoint.new(0, 0.5, 0),
  440. NumberSequenceKeypoint.new(1, 1, 0)
  441. })
  442.  
  443. local trailbot1 = Instance.new("Trail", c["Right Arm"])
  444. trailbot1.Enabled = true
  445. trailbot1.Texture = "rbxassetid://16607923"
  446. trailbot1.Name = "bottrail"
  447. trailbot1.MinLength = 0
  448. trailbot1.Lifetime = 0.1
  449. spawn(function()
  450. while true do wait()
  451. trailbot1.Color = ColorSequence.new(ColorArray)
  452. end
  453. end)
  454. trailbot1.Attachment0 = att3
  455. trailbot1.Attachment1 = att4
  456. trailbot1.Transparency = NumberSequence.new({
  457. NumberSequenceKeypoint.new(0, 0.5, 0),
  458. NumberSequenceKeypoint.new(1, 1, 0)
  459. })
  460.  
  461. local trailside1 = Instance.new("Trail", c["Right Arm"])
  462. trailside1.Enabled = true
  463. trailside1.Texture = "rbxassetid://16607923"
  464. trailside1.Name = "sidetrail1"
  465. trailside1.MinLength = 0
  466. trailside1.Lifetime = 0.1
  467.  
  468. trailside1.Color = ColorSequence.new(ColorArray)
  469.  
  470. trailside1.Attachment0 = att1
  471. trailside1.Attachment1 = att3
  472. trailside1.Transparency = NumberSequence.new({
  473. NumberSequenceKeypoint.new(0, 0.5, 0),
  474. NumberSequenceKeypoint.new(1, 1, 0)
  475. })
  476.  
  477. local trailside2 = Instance.new("Trail", c["Right Arm"])
  478. trailside2.Enabled = true
  479. trailside2.Texture = "rbxassetid://16607923"
  480. trailside2.Name = "sidetrail2"
  481. trailside2.MinLength = 0
  482. trailside2.Lifetime = 0.1
  483.  
  484. trailside2.Color = ColorSequence.new(ColorArray)
  485.  
  486. trailside2.Attachment0 = att2
  487. trailside2.Attachment1 = att4
  488. trailside2.Transparency = NumberSequence.new({
  489. NumberSequenceKeypoint.new(0, 0.5, 0),
  490. NumberSequenceKeypoint.new(1, 1, 0)
  491. })
  492.  
  493.  
  494. local trailtop12 = Instance.new("Trail", c["Left Arm"])
  495. trailtop12.Enabled = true
  496. trailtop12.Texture = "rbxassetid://16607923"
  497. trailtop12.Name = "toptrail"
  498. trailtop12.MinLength = 0
  499. trailtop12.Lifetime = 0.1
  500.  
  501. trailtop12.Color = ColorSequence.new(ColorArray)
  502.  
  503. trailtop12.Attachment0 = attt1
  504. trailtop12.Attachment1 = attt2
  505. trailtop12.Transparency = NumberSequence.new({
  506. NumberSequenceKeypoint.new(0, 0.5, 0),
  507. NumberSequenceKeypoint.new(1, 1, 0)
  508. })
  509.  
  510. local trailbot2 = Instance.new("Trail", c["Left Arm"])
  511. trailbot2.Enabled = true
  512. trailbot2.Texture = "rbxassetid://16607923"
  513. trailbot2.Name = "bottrail"
  514. trailbot2.MinLength = 0
  515. trailbot2.Lifetime = 0.1
  516.  
  517. trailbot2.Color = ColorSequence.new(ColorArray)
  518.  
  519. trailbot2.Attachment0 = attt3
  520. trailbot2.Attachment1 = attt4
  521. trailbot2.Transparency = NumberSequence.new({
  522. NumberSequenceKeypoint.new(0, 0.5, 0),
  523. NumberSequenceKeypoint.new(1, 1, 0)
  524. })
  525.  
  526. local trailside12 = Instance.new("Trail", c["Left Arm"])
  527. trailside12.Enabled = true
  528. trailside12.Texture = "rbxassetid://16607923"
  529. trailside12.Name = "sidetrail1"
  530. trailside12.MinLength = 0
  531. trailside12.Lifetime = 0.1
  532.  
  533. trailside12.Color = ColorSequence.new(ColorArray)
  534.  
  535. trailside12.Attachment0 = attt1
  536. trailside12.Attachment1 = attt3
  537. trailside12.Transparency = NumberSequence.new({
  538. NumberSequenceKeypoint.new(0, 0.5, 0),
  539. NumberSequenceKeypoint.new(1, 1, 0)
  540. })
  541.  
  542. local trailside22 = Instance.new("Trail", c["Left Arm"])
  543. trailside22.Enabled = true
  544. trailside22.Texture = "rbxassetid://16607923"
  545. trailside22.Name = "sidetrail2"
  546. trailside22.MinLength = 0
  547. trailside22.Lifetime = 0.1
  548.  
  549. trailside22.Color = ColorSequence.new(ColorArray)
  550.  
  551. trailside22.Attachment0 = attt2
  552. trailside22.Attachment1 = attt4
  553. trailside22.Transparency = NumberSequence.new({
  554. NumberSequenceKeypoint.new(0, 0.5, 0),
  555. NumberSequenceKeypoint.new(1, 1, 0)
  556. })
  557.  
  558. local att1 = Instance.new("Attachment", c["Torso"])
  559. att1.Name = "att1"
  560. att1.Position = Vector3.new(1, 1, 0.5)
  561. local att2 = Instance.new("Attachment", c["Torso"])
  562. att2.Name = "att2"
  563. att2.Position = Vector3.new(-1, 1, 0.5)
  564. local att3 = Instance.new("Attachment", c["Torso"])
  565. att3.Name = "att3"
  566. att3.Position = Vector3.new(1, -1, 0.5)
  567. local att4 = Instance.new("Attachment", c["Torso"])
  568. att4.Name = "att4"
  569. att4.Position = Vector3.new(-1, -1, 0.5)
  570.  
  571. local attt1 = Instance.new("Attachment", c["Head"])
  572. attt1.Name = "att1"
  573. attt1.Position = Vector3.new(.55, .55, 0.025)
  574. local attt2 = Instance.new("Attachment", c["Head"])
  575. attt2.Name = "att2"
  576. attt2.Position = Vector3.new(-.55, .55, 0.025)
  577. local attt3 = Instance.new("Attachment", c["Head"])
  578. attt3.Name = "att3"
  579. attt3.Position = Vector3.new(.55, -.5, 0.025)
  580. local attt4 = Instance.new("Attachment", c["Head"])
  581. attt4.Name = "att4"
  582. attt4.Position = Vector3.new(-.55, -.5, 0.025)
  583. local trailtop1 = Instance.new("Trail", c["Torso"])
  584. trailtop1.Enabled = true
  585. trailtop1.Texture = "rbxassetid://16607923"
  586. trailtop1.Name = "toptrail"
  587. trailtop1.MinLength = 0
  588. trailtop1.Lifetime = 0.1
  589.  
  590. trailtop1.Color = ColorSequence.new(ColorArray)
  591.  
  592. trailtop1.Attachment0 = att1
  593. trailtop1.Attachment1 = att2
  594. trailtop1.Transparency = NumberSequence.new({
  595. NumberSequenceKeypoint.new(0, 0.5, 0),
  596. NumberSequenceKeypoint.new(1, 1, 0)
  597. })
  598. local trailbot1 = Instance.new("Trail", c["Torso"])
  599. trailbot1.Enabled = true
  600. trailbot1.Texture = "rbxassetid://16607923"
  601. trailbot1.Name = "bottrail"
  602. trailbot1.MinLength = 0
  603. trailbot1.Lifetime = 0.1
  604.  
  605. trailbot1.Color = ColorSequence.new(ColorArray)
  606.  
  607. trailbot1.Attachment0 = att3
  608. trailbot1.Attachment1 = att4
  609. trailbot1.Transparency = NumberSequence.new({
  610. NumberSequenceKeypoint.new(0, 0.5, 0),
  611. NumberSequenceKeypoint.new(1, 1, 0)
  612. })
  613. local trailside1 = Instance.new("Trail", c["Torso"])
  614. trailside1.Enabled = true
  615. trailside1.Texture = "rbxassetid://16607923"
  616. trailside1.Name = "sidetrail1"
  617. trailside1.MinLength = 0
  618. trailside1.Lifetime = 0.1
  619.  
  620. trailside1.Color = ColorSequence.new(ColorArray)
  621.  
  622. trailside1.Attachment0 = att1
  623. trailside1.Attachment1 = att3
  624. trailside1.Transparency = NumberSequence.new({
  625. NumberSequenceKeypoint.new(0, 0.5, 0),
  626. NumberSequenceKeypoint.new(1, 1, 0)
  627. })
  628. local trailside2 = Instance.new("Trail", c["Torso"])
  629. trailside2.Enabled = true
  630. trailside2.Texture = "rbxassetid://16607923"
  631. trailside2.Name = "sidetrail2"
  632. trailside2.MinLength = 0
  633. trailside2.Lifetime = 0.1
  634.  
  635. trailside2.Color = ColorSequence.new(ColorArray)
  636.  
  637. trailside2.Attachment0 = att2
  638. trailside2.Attachment1 = att4
  639. trailside2.Transparency = NumberSequence.new({
  640. NumberSequenceKeypoint.new(0, 0.5, 0),
  641. NumberSequenceKeypoint.new(1, 1, 0)
  642. })
  643. local trailtop12 = Instance.new("Trail", c["Head"])
  644. trailtop12.Enabled = true
  645. trailtop12.Texture = "rbxassetid://16607923"
  646. trailtop12.Name = "toptrail"
  647. trailtop12.MinLength = 0
  648. trailtop12.Lifetime = 0.1
  649.  
  650. trailtop12.Color = ColorSequence.new(ColorArray)
  651.  
  652. trailtop12.Attachment0 = attt1
  653. trailtop12.Attachment1 = attt2
  654. trailtop12.Transparency = NumberSequence.new({
  655. NumberSequenceKeypoint.new(0, 0.5, 0),
  656. NumberSequenceKeypoint.new(1, 1, 0)
  657. })
  658. local trailbot2 = Instance.new("Trail", c["Head"])
  659. trailbot2.Enabled = true
  660. trailbot2.Texture = "rbxassetid://16607923"
  661. trailbot2.Name = "bottrail"
  662. trailbot2.MinLength = 0
  663. trailbot2.Lifetime = 0.1
  664.  
  665. trailbot2.Color = ColorSequence.new(ColorArray)
  666.  
  667. trailbot2.Attachment0 = attt3
  668. trailbot2.Attachment1 = attt4
  669. trailbot2.Transparency = NumberSequence.new({
  670. NumberSequenceKeypoint.new(0, 0.5, 0),
  671. NumberSequenceKeypoint.new(1, 1, 0)
  672. })
  673. local trailside12 = Instance.new("Trail", c["Head"])
  674. trailside12.Enabled = true
  675. trailside12.Texture = "rbxassetid://16607923"
  676. trailside12.Name = "sidetrail1"
  677. trailside12.MinLength = 0
  678. trailside12.Lifetime = 0.1
  679.  
  680. trailside12.Color = ColorSequence.new(ColorArray)
  681.  
  682. trailside12.Attachment0 = attt1
  683. trailside12.Attachment1 = attt3
  684. trailside12.Transparency = NumberSequence.new({
  685. NumberSequenceKeypoint.new(0, 0.5, 0),
  686. NumberSequenceKeypoint.new(1, 1, 0)
  687. })
  688. local trailside22 = Instance.new("Trail", c["Head"])
  689. trailside22.Enabled = true
  690. trailside22.Texture = "rbxassetid://16607923"
  691. trailside22.Name = "sidetrail2"
  692. trailside22.MinLength = 0
  693. trailside22.Lifetime = 0.1
  694.  
  695. trailside22.Color = ColorSequence.new(ColorArray)
  696.  
  697. trailside22.Attachment0 = attt2 trailside22.Attachment1 = attt4
  698. trailside22.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.5, 0),NumberSequenceKeypoint.new(1, 1, 0)})
  699.  
  700. Sped = 0
  701.  
  702. function ragplayer(cactus)
  703. local S = Instance.new("Sound",c.HumanoidRootPart)S.SoundId = "rbxassetid://131026421" S.Volume = 2 S:Play()
  704. cactus.Humanoid.PlatformStand = true cactus:findFirstChild("Humanoid").Health = 0.01
  705. if cactus["Right Arm"]~=nil and cactus.Torso:FindFirstChild("Right Shoulder") then
  706. cactus.Torso:FindFirstChild("Right Shoulder"):Destroy()
  707. makegloo(cactus.Torso, RSC0, RSC1, cactus.Torso, cactus["Right Arm"], "Right Shoulder")
  708. maketouchy(cactus["Right Arm"], cactus["Right Arm"], CFrame.new(0, 0.5, 0))
  709. end
  710. if cactus["Left Arm"]~=nil and cactus.Torso:FindFirstChild("Left Shoulder") then
  711. cactus.Torso:FindFirstChild("Left Shoulder"):Destroy()
  712. makegloo(cactus.Torso, LSC0, LSC1, cactus.Torso, cactus["Left Arm"], "Left Shoulder")
  713. maketouchy(cactus["Left Arm"], cactus["Left Arm"], CFrame.new(0, 0.5, 0))
  714. end
  715. if cactus["Right Leg"]~=nil and cactus.Torso:FindFirstChild("Right Hip") then
  716. cactus.Torso:FindFirstChild("Right Hip"):Destroy()
  717. makegloo(cactus.Torso, RHC0, RHC1, cactus.Torso, cactus["Right Leg"], "Right Hip")
  718. maketouchy(cactus["Right Leg"], cactus["Right Leg"], CFrame.new(0, 0.5, 0))
  719. end
  720. if cactus["Left Leg"]~=nil and cactus.Torso:FindFirstChild("Left Hip") then
  721. cactus.Torso:FindFirstChild("Left Hip"):Destroy()
  722. makegloo(cactus.Torso, LHC0, LHC1, cactus.Torso, cactus["Left Leg"], "Left Hip")
  723. maketouchy(cactus["Left Leg"], cactus["Left Leg"], CFrame.new(0, 0.5, 0))
  724. end
  725. cactus.Parent = game.Workspace game.Debris:AddItem(cactus,15)
  726. end
  727. function makegloo(paren, co, ci, parto, parti, nam) local gloo = Instance.new("Glue") gloo.Name = nam gloo.C0 = co gloo.C1 = ci gloo.Part0 = parto gloo.Part1 = parti gloo.Parent = paren end
  728.  
  729. function maketouchy(parent, limb, cframe) local pr = Instance.new("Part") pr.Name = "touchy" pr.Size = Vector3.new(1, 1, 1) pr.Transparency = 1 pr.CustomPhysicalProperties = PhysicalProperties.new(0.55, 0.3, 0.5) pr.CanCollide = true pr.Anchored = false pr.Parent = parent local w = Instance.new("Weld") w.Part0 = pr w.Part1 = limb w.C0 = cframe w.Parent = pr end
  730.  
  731. local hitz = false
  732. c.HumanoidRootPart.Touched:connect(function(Hit)
  733. if thing >= 100 then
  734. if hitz == false then hitz = true
  735. ragplayer(c) local S = Instance.new("Sound",c.HumanoidRootPart)S.SoundId = "rbxassetid://386946017" S.Volume = 6 S:Play()
  736. wait(15)
  737. end
  738. end
  739. end)
  740.  
  741. function Spin()
  742. attack = true
  743. while attack == true do Sped = Sped + 0.25
  744. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(Sped*Sped*5), rd(0), rd(0)), 1)
  745. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(60), rd(0), rd(0)), 1)
  746. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(15), rd(25), rd(25)), 1)
  747. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  748. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(15), rd(-25), rd(-25)), 1)
  749. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  750. lerpz(RH, "C0", RHC0 * cf(0.5, 1.5, 0) * ang(rd(0), rd(0), rd(0)), 1)
  751. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  752. lerpz(LH, "C0", LHC0 * cf(-0.5, 1.5, 0) * ang(rd(0), rd(0), rd(0)), 1)
  753. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  754. swait()
  755. end
  756. end
  757.  
  758. SanicScreams = {585370931,202427593}
  759.  
  760. mouse.KeyDown:connect(function(key)
  761. if attack == true then return end
  762. if key == "q" then
  763. Spin()
  764. end
  765. if key == "e" then
  766. local S = Instance.new("Sound",c.HumanoidRootPart)S.SoundId = "rbxassetid://537371462" S.Volume = 10 S:Play()
  767. wait(1.25)
  768. local Sanic = SanicScreams[math.random(1,#SanicScreams)]
  769. local S = Instance.new("Sound",c.HumanoidRootPart)S.SoundId = "rbxassetid://"..Sanic S.Volume = 10 S:Play()
  770. spawn(function()
  771. local Sp = Instance.new("Part",game.Workspace)Sp.BrickColor = BrickColor.new("Cyan")Sp.Material = "Neon" Sp.Size = Vector3.new(1,1,1) Sp.Anchored = true Sp.CanCollide = false
  772. local SPM = Instance.new("SpecialMesh",Sp)SPM.MeshType = "Sphere" Sp.CFrame = c.HumanoidRootPart.CFrame
  773. for i = 1,25 do
  774. SPM.Scale = SPM.Scale + Vector3.new(4,4,4)
  775. Sp.Transparency = Sp.Transparency + 1/25
  776. swait()
  777. end
  778. end)
  779. local S = Instance.new("Sound",c.HumanoidRootPart)S.SoundId = "rbxassetid://214444596" S.Volume = 10 S:Play()
  780. Sped = 10000000000
  781. end
  782. end)
  783.  
  784. mouse.KeyUp:connect(function(key)
  785. if key == "q" then
  786. attack = false
  787. end
  788. end)
  789.  
  790. local P = Instance.new("Part",game.Workspace.CurrentCamera)P.CanCollide = true P.Anchored = true P.Size = Vector3.new(15,1,15)
  791. P.CFrame = CFrame.new(c.HumanoidRootPart.Position)*CFrame.new(0,-3.5,0)P.Transparency = 0 P.Name = "FlightPart"
  792. P.BrickColor = BrickColor.new("Dark green") P.TopSurface = "Smooth" P.Material = "Grass"
  793. spawn(function()
  794. while true do
  795. P.CFrame = CFrame.new(c.HumanoidRootPart.Position.X,-0.6,c.HumanoidRootPart.Position.Z)
  796. swait()
  797. end
  798. end)
  799.  
  800. anim.Parent = nil
  801. sine = 0
  802.  
  803. game:GetService("RunService").RenderStepped:connect(function()
  804. if attack == false then
  805. thing = (c.HumanoidRootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  806. game.Workspace.CurrentCamera.FieldOfView = 70+thing/100
  807. if c.HumanoidRootPart.Velocity.Y > 1 then sine = sine + 1
  808. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(sine*thing*0.75), rd(0), rd(0)), 1)
  809. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(60), rd(0), rd(0)), 1)
  810. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(15), rd(25), rd(25)), 1)
  811. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  812. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(15), rd(-25), rd(-25)), 1)
  813. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  814. lerpz(RH, "C0", RHC0 * cf(0.5, 1.5, 0) * ang(rd(0), rd(0), rd(0)), 1)
  815. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  816. lerpz(LH, "C0", LHC0 * cf(-0.5, 1.5, 0) * ang(rd(0), rd(0), rd(0)), 1)
  817. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  818. elseif (c.HumanoidRootPart.Velocity * Vector3.new(1, 0, 1)).magnitude > 2 then
  819. sine = sine + 1 Sped = Sped + 0.1
  820. if thing <= 200 then
  821. if S2.PlaybackSpeed >= 1 then
  822. S2.PlaybackSpeed = 1
  823. else
  824. S2.PlaybackSpeed = thing/80
  825. end
  826. c.Humanoid.WalkSpeed = 16+(thing/1.5)+Sped
  827. S2.Volume = thing/20
  828. end
  829. if thing <= 200 then
  830. c.Humanoid.WalkSpeed = 16+(thing/1.5)+Sped
  831. S2.Volume = thing/20
  832. else
  833. c.Humanoid.WalkSpeed = 16+(thing/1.5)+Sped
  834. end
  835. if thing <= 100 then
  836. for i,v in pairs(c:children()) do
  837. if v.ClassName == "Part" then
  838. for i,v2 in pairs(v:children()) do
  839. if v2.ClassName == "Trail" then
  840. v2.Enabled = false
  841. v2.LightEmission = 1
  842. end
  843. end
  844. end
  845. end
  846. else
  847. for i,v in pairs(c:children()) do
  848. if v.ClassName == "Part" then
  849. for i,v2 in pairs(v:children()) do
  850. if v2.ClassName == "Trail" then
  851. v2.Lifetime = 2
  852. v2.Enabled = true
  853. end
  854. end
  855. end
  856. end
  857. end
  858. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(thing/7), rd(0), rd(0)), 1)
  859. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  860. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(-thing/1.5)), 1)
  861. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  862. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(thing/1.5)), 1)
  863. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  864. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(math.cos(sine/2))*thing/1.25), 1)
  865. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  866. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(math.cos(sine/2))*thing/1.25), 1)
  867. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 1)
  868. else c.Humanoid.WalkSpeed = 16 Sped = 0 sine = sine + 1 S2.Volume = 0 S2.PlaybackSpeed = 0
  869. lerpz(RJ, "C0", RJC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  870. lerpz(N, "C0", NC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  871. lerpz(RS, "C0", RSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(math.cos(sine/24)*4)), 0.5)
  872. lerpz(RS, "C1", RSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  873. lerpz(LS, "C0", LSC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(math.cos(sine/24)*4)), 0.5)
  874. lerpz(LS, "C1", LSC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  875. lerpz(RH, "C0", RHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  876. lerpz(RH, "C1", RHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  877. lerpz(LH, "C0", LHC0 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  878. lerpz(LH, "C1", LHC1 * cf(0, 0, 0) * ang(rd(0), rd(0), rd(0)), 0.5)
  879. end
  880. for i,v in pairs (c:children()) do
  881. if v.ClassName == "Accessory" then
  882. for i,v2 in pairs (v:children()) do
  883. if v2.ClassName == "Part" then
  884. v2.Anchored = false
  885. end
  886. end
  887. end
  888. for i,v in pairs (c:children()) do
  889. if v.ClassName == "Part" then
  890. v.Anchored = false
  891. end
  892. end
  893. end
  894. end
  895. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement