Advertisement
Ban43_GodOfEdits

tiem stuff

May 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.74 KB | None | 0 0
  1. --[[ Time Testing ]]--
  2. -------------------------------------------------------
  3. --[[
  4.  
  5. This script was created by WafflesAreVeryGood.
  6. ATTACKS
  7. Fixed by wistfulandrei
  8. _______
  9.  
  10.  
  11. --]]
  12. -------------------------------------------------------
  13. print("This script was created by WafflesAreVeryGood!")
  14. warn("Fixed by wistfulandrei")
  15. --[[Changeable Variables]]--
  16. local multiplier = 1 --Attack multiplier (default is 1)
  17. local soundlist = {
  18. HardHit1 = "rbxassetid://565207203",
  19. HardHit2 = "rbxassetid://541909913",
  20. HardHit3 = "rbxassetid://541909983",
  21. WeakHit1 = "rbxassetid://558642292",
  22. WeakHit2 = "rbxassetid://541907812",
  23. Slice1 = "rbxassetid://260429964",
  24. Slice2 = "rbxassetid://260430015",
  25. Explosion1 = "rbxassetid://138186576",
  26. Explosion2 = "rbxassetid://157878578",
  27. Woosh1 = "rbxassetid://541909867",
  28. Woosh2 = "rbxassetid://541909763",
  29. TimeSlow = "rbxassetid://615678808",
  30. TimeStop = "rbxassetid://926382097",
  31. TimeResume = "rbxassetid://894793352",
  32. TimeFast = "rbxassetid://743499393",
  33. TimeReverse = "rbxassetid://618737332",
  34.  
  35. }
  36.  
  37. --[[Important Variables]]--
  38. local plr = game:GetService('Players').LocalPlayer
  39. local char = plr.Character
  40. local mouse = plr:GetMouse()
  41. local input = game:GetService('UserInputService')
  42. ----
  43. local joints = {"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}
  44. local torso,head,rootpart = char.Torso,char.Head,char.HumanoidRootPart
  45. local rs = torso["Right Shoulder"]
  46. local ls = torso["Left Shoulder"]
  47. local rh = torso["Right Hip"]
  48. local lh = torso["Left Hip"]
  49. local neck = torso.Neck
  50. local rj = rootpart["RootJoint"]
  51. ----
  52. local huge = Vector3.new(math.huge, math.huge, math.huge)
  53. local attacking = false
  54. local cananim = true
  55. local timestop = false
  56. local timeslow = false
  57. local timefast = false
  58. local reversing = false
  59. local unfreeze = {}
  60. local sounddata = {}
  61. local connections = {}
  62. local healthstuff = {}
  63.  
  64. --[[ Functions ]]--
  65. function addattack(keycode, func)
  66. input.InputBegan:connect(function(inp)
  67. if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
  68. func()
  69. end
  70. end)
  71. end
  72. function attackend(keycode, func)
  73. input.InputEnded:connect(function(inp)
  74. if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
  75. func()
  76. end
  77. end)
  78. end
  79. function swait(t)
  80. if t then
  81. for i = 0, t do
  82. game:GetService('RunService').Stepped:wait(0)
  83. end
  84. else
  85. game:GetService('RunService').Stepped:wait(0)
  86. end
  87. return true
  88. end
  89. function fade(obj, dest, grow)
  90. spawn(function()
  91. local oldcf = obj.CFrame
  92. for i = 0, 10 do
  93. if grow then
  94. obj.Size = obj.Size +Vector3.new(1,1,1)
  95. obj.CFrame = oldcf
  96. end
  97. obj.Transparency = obj.Transparency +0.1
  98. swait()
  99. end
  100. if dest then
  101. obj:Destroy()
  102. end
  103. end)
  104. end
  105. function replacejoint(name)
  106. local j = torso:FindFirstChild(name)
  107. if not j then j = char.HumanoidRootPart:FindFirstChild(name) end
  108. if j then
  109. if true then
  110. local already = j.Parent:FindFirstChild(j.Name.." Replacement")
  111. local new = Instance.new("Weld")
  112. local c0 = j.C0
  113. local c1 = j.C1
  114. new.Part0 = j.Part0
  115. j.Part0 = nil
  116. new.Name = j.Name.." Replacement"
  117. if already then c0 = already.C0 c1 = already.C1 already:Destroy() end
  118. new.Parent = j.Parent
  119. new.Part1 = j.Part1
  120. new.C0 = c0
  121. new.C1 = c1
  122. return new
  123. end
  124. end
  125. end
  126. function removejoint(name, fast)
  127. local j = torso:FindFirstChild(name.." Replacement")
  128. if not j then j = char.HumanoidRootPart:FindFirstChild(name.." Replacement") end
  129. if j then
  130. local p0 = j.Part0
  131. if p0 ~= nil then
  132. local c0 = j.C0
  133. local c1 = j.C1
  134. j:Destroy()
  135. local new = p0:FindFirstChild(name)
  136. local ac0 = new.C0
  137. local ac1 = new.C1
  138. new.Part0 = p0
  139. new.C0 = c0
  140. new.C1 = c1
  141. spawn(function()
  142. if name ~= "RootJoint" then
  143. if not fast then
  144. for i = 0, 0.6, 0.1 do
  145. new.C0 = new.C0:Lerp(ac0, 0.5)
  146. new.C1 = new.C1:lerp(ac1, 0.5)
  147. swait()
  148. end
  149. else
  150. new.C0 = new.C0:Lerp(ac0, 1)
  151. new.C1 = new.C1:lerp(ac1, 1)
  152. end
  153. end
  154. end)
  155. end
  156. end
  157. end
  158. function fixalljoints(fast)
  159. for i,v in pairs({"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}) do
  160. removejoint(v, fast)
  161. end
  162. end
  163. function getnewjoints()
  164. local rs = replacejoint("Right Shoulder")
  165. local ls = replacejoint("Left Shoulder")
  166. local rh = replacejoint("Right Hip")
  167. local lh = replacejoint("Left Hip")
  168. local neck = replacejoint("Neck")
  169. local rj = replacejoint("RootJoint")
  170. return rs,ls,rh,lh,neck,rj
  171. end
  172. function knockback(hit, force)
  173. local bv = Instance.new("BodyVelocity")
  174. bv.MaxForce = huge
  175. bv.Velocity = force
  176. bv.Parent = hit
  177. game:GetService('Debris'):AddItem(bv, 0.15)
  178. end
  179. function soundeffect(id, volume, speed, parent, forcewait)
  180. local func = function()
  181. local s = LoadLibrary("RbxUtility").Create("Sound")()
  182. s.Name = "SoundEffect"
  183. s.Volume = volume
  184. s.PlaybackSpeed = speed
  185. s.SoundId = id
  186. s.Name = "dont"
  187. s.Looped = false
  188. s.Parent = parent
  189. s:Play()
  190. repeat wait() until not s.Playing
  191. s:Destroy()
  192. end
  193. if forcewait then
  194. func()
  195. else
  196. spawn(func)
  197. end
  198. end
  199. function getascendants(obj)
  200. local par = obj
  201. local ret = {}
  202. pcall(function()
  203. repeat
  204. par = par.Parent
  205. if par ~= nil then
  206. table.insert(ret, par)
  207. end
  208. until par == nil
  209. end)
  210. return ret
  211. end
  212. function findascendant(obj, class)
  213. local par = obj
  214. local ret = nil
  215. pcall(function()
  216. repeat
  217. par = par.Parent
  218. if par:IsA(class) then
  219. ret = par
  220. break
  221. end
  222. until par == nil
  223. end)
  224. return ret
  225. end
  226. function hurt(hit, dmg)
  227. --pcall(function()
  228. local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  229. if hum then
  230. if hum.Parent ~= char then
  231. hum.Health = hum.Health - dmg
  232. hum.Health = hum.Health - dmg
  233. soundeffect(soundlist.Headshot, 1.5, 1, workspace.CurrentCamera)
  234. return true
  235. end
  236. end
  237. --end)
  238. end
  239. --[[ Actual script :OOOOOOOOOO ]]--
  240. addattack(Enum.KeyCode.G, function()
  241. if not timeslow and not timefast and not reversing then
  242. local p = Instance.new("Part")
  243. p.Anchored = true
  244. p.Material = "Glass"
  245. p.Size = Vector3.new(0.1,0.1,0.1)
  246. p.BrickColor = BrickColor.new("Toothpaste")
  247. p.CanCollide = false
  248. p.CFrame = char.HumanoidRootPart.CFrame
  249. local m = Instance.new("SpecialMesh")
  250. m.MeshType = "Sphere"
  251. m.Parent = p
  252. p.Parent = char
  253. spawn(function()
  254. for i = 1, 50 do
  255. p.Transparency = i/50
  256. p.Size = p.Size:Lerp(Vector3.new(40,40,40),0.1)
  257. p.CFrame = char.HumanoidRootPart.CFrame
  258. swait()
  259. end
  260. p:Destroy()
  261. end)
  262. if not timestop then
  263. local s = Instance.new("Sound")
  264. s.Volume = 3
  265. s.Name = "dont"
  266. s.SoundId = soundlist.TimeStop
  267. s.Parent = char
  268. s:Play()
  269. dcon = workspace.DescendantAdded:connect(function(obj)
  270. pcall(function()
  271. swait()
  272. local ok = true
  273. for i,v in pairs(getascendants(obj)) do
  274. if v.Name:lower():find("ignoremodel") then
  275. ok = false
  276. end
  277. end
  278. if obj:IsA("BasePart") and ok and not findascendant(obj, "Tool") and not findascendant(obj, "HopperBin") and not findascendant(obj, "Camera") then
  279. if not obj.Anchored and obj.Name ~= "HumanoidRootPart" then
  280. table.insert(unfreeze, obj)
  281. obj.Anchored = true
  282. end
  283. end
  284. if obj:IsA("Sound") and obj.Name ~= "dont" then
  285. if obj.Playing then
  286. obj:Pause()
  287. table.insert(unfreeze, obj)
  288. end
  289. end
  290. if obj:IsA("Humanoid") then
  291. local last = obj.Health
  292. local always = last
  293. local con = obj.HealthChanged:connect(function(health)
  294. if last-health > 0 then
  295. table.insert(healthstuff, {hum = obj, change = last-health})
  296. end
  297. last = health
  298. obj.Health = always
  299. end)
  300. table.insert(connections, con)
  301. end
  302. end)
  303. end)
  304. for i,v in pairs(workspace:GetDescendants()) do
  305. pcall(function()
  306. if v:IsA("BasePart") then
  307. local ok = true
  308. for i,e in pairs(getascendants(v)) do
  309. if e.Name:lower():find("ignore_model") then
  310. ok = false
  311. end
  312. if e:IsA("Camera") then
  313. ok = false
  314. end
  315. end
  316. if not v.Anchored and ok and v.Parent ~= char and not findascendant(v, "Camera") and not findascendant(v, "Tool") and not findascendant(v, "HopperBin") then
  317. local ok = true
  318. if v.Parent:IsA("Accessory") then ok = false end
  319. if ok and v.Name ~= "HumanoidRootPart" then
  320. v.Anchored = true
  321. table.insert(unfreeze, v)
  322. end
  323. end
  324. end
  325. end)
  326. pcall(function()
  327. if v:IsA("Sound") and v.Name ~= "dont" then
  328. if v.Playing then
  329. v:Pause()
  330. table.insert(unfreeze, v)
  331. end
  332. end
  333. end)
  334. pcall(function()
  335. if v:IsA("Humanoid") then
  336. local last = v.Health
  337. local always = last
  338. local con = v.HealthChanged:connect(function(health)
  339. if last-health > 0 then
  340. table.insert(healthstuff, {hum = v, change = last-health})
  341. end
  342. last = health
  343. v.Health = always
  344. end)
  345. table.insert(connections, con)
  346. end
  347. end)
  348. end
  349. timestop = true
  350. local cor = Instance.new("ColorCorrectionEffect")
  351. cor.Name = "tstopef"
  352. cor.Parent = game:GetService('Lighting')
  353. for i = 1, 50 do
  354. cor.Saturation = Vector3.new(cor.Saturation,0,0):Lerp(Vector3.new(-5,0,0), 0.05).X
  355. swait()
  356. end
  357. game.Debris:AddItem(s, 2)
  358. else
  359. local s = Instance.new("Sound")
  360. s.Volume = 7
  361. s.Name = "dont"
  362. s.SoundId = soundlist.TimeResume
  363. s.Parent = char
  364. s:Play()
  365. local cor = game:GetService('Lighting'):FindFirstChild("tstopef")
  366. if cor then
  367. for i = 1, 50 do
  368. cor.Saturation = Vector3.new(cor.Saturation,0,0):Lerp(Vector3.new(0,0,0), 0.05).X
  369. swait()
  370. end
  371. cor:Destroy()
  372. end
  373. game.Debris:AddItem(s, 2)
  374. timestop = false
  375. for i,v in pairs(unfreeze) do
  376. pcall(function()
  377. v.Anchored = false
  378. end)
  379. pcall(function()
  380. v:Resume()
  381. end)
  382. end
  383. for i,v in pairs(connections) do
  384. pcall(function()
  385. v:disconnect()
  386. end)
  387. end
  388. for i,v in pairs(healthstuff) do
  389. pcall(function()
  390. local hum = v.hum
  391. hum.Health = hum.Health - v.change
  392. if hum.Parent:FindFirstChild("Health") then
  393. pcall(function()
  394. hum.Parent.Health.Disabled = false
  395. end)
  396. end
  397. end)
  398. end
  399. pcall(function()
  400. dcon:disconnect()
  401. end)
  402. healthstuff = {}
  403. unfreeze = {}
  404. end
  405. end
  406. end)
  407. local humanoiddata = {}
  408. local bodymoverdata = {}
  409. local dcon2
  410. local connectionsdata = {}
  411. addattack(Enum.KeyCode.H, function()
  412. if not timeslow and not timestop and not reversing then
  413. local p = Instance.new("Part")
  414. p.Anchored = true
  415. p.Material = "Glass"
  416. p.Size = Vector3.new(0.1,0.1,0.1)
  417. p.BrickColor = BrickColor.new("Toothpaste")
  418. p.CanCollide = false
  419. p.CFrame = char.HumanoidRootPart.CFrame
  420. local m = Instance.new("SpecialMesh")
  421. m.MeshType = "Sphere"
  422. m.Parent = p
  423. p.Parent = char
  424. spawn(function()
  425. for i = 1, 50 do
  426. p.Transparency = i/50
  427. p.Size = p.Size:Lerp(Vector3.new(40,40,40),0.1)
  428. p.CFrame = char.HumanoidRootPart.CFrame
  429. swait()
  430. end
  431. p:Destroy()
  432. end)
  433. if not timefast then
  434. timefast = true
  435. soundeffect(soundlist.TimeFast, 1.5, 1, char)
  436. for i,v in pairs(workspace:GetDescendants()) do
  437. if v:IsA("Humanoid") then
  438. table.insert(humanoiddata, {Hum = v, WS = v.WalkSpeed, JP = v.JumpPower})
  439. for _,track in pairs(v:GetPlayingAnimationTracks()) do
  440. end
  441. local con = v.AnimationPlayed:connect(function(track)
  442. end)
  443. table.insert(connections, con)
  444. end
  445. if v:IsA("BodyVelocity") then
  446. table.insert(bodymoverdata, {Mover = v, Vel = v.Velocity})
  447. end
  448. if v:IsA("BodyPosition") then
  449. table.insert(bodymoverdata, {Mover = v, Vel = v.P})
  450. end
  451. if v.Name == "HumanoidRootPart" and v:IsA("BasePart") then
  452. end
  453. if v:IsA("Sound") and v.Name ~= "dont" then
  454. table.insert(sounddata, {Sound = v, Speed = v.PlaybackSpeed})
  455. end
  456. end
  457. dcon2 = workspace.DescendantAdded:connect(function(v)
  458. swait(2)
  459. if v:IsA("Humanoid") then
  460. table.insert(humanoiddata, {Hum = v, WS = v.WalkSpeed, JP = v.JumpPower})
  461. for _,track in pairs(v:GetPlayingAnimationTracks()) do
  462. track:AdjustSpeed(1.4)
  463. end
  464. local con = v.AnimationPlayed:connect(function(track)
  465. track:AdjustSpeed(1.4)
  466. end)
  467. table.insert(connections, con)
  468. end
  469. if v:IsA("BodyVelocity") then
  470. table.insert(bodymoverdata, {Mover = v, Vel = v.Velocity})
  471. end
  472. if v:IsA("BodyPosition") then
  473. table.insert(bodymoverdata, {Mover = v, Vel = v.P})
  474. end
  475. if v.Name == "HumanoidRootPart" and v:IsA("BasePart") then
  476. end
  477. if v:IsA("Sound") and v.Name ~= "dont" then
  478. table.insert(sounddata, {Sound = v, Speed = v.PlaybackSpeed})
  479. end
  480. end)
  481. else
  482. timefast = false
  483. soundeffect(soundlist.TimeResume, 1.5, 1, char)
  484. for i,v in pairs(humanoiddata) do
  485. pcall(function()
  486. v["Hum"].WalkSpeed = v["WS"]
  487. v["Hum"].JumpPower = v["JP"]
  488. end)
  489. end
  490. for i,v in pairs(bodymoverdata) do
  491. pcall(function()
  492. if v["Mover"]:IsA("BodyVelocity") then
  493. v["Mover"].Velocity = v["Vel"]
  494. end
  495. if v["Mover"]:IsA("BodyPosition") then
  496. v["Mover"].P = v["Vel"]
  497. end
  498. end)
  499. end
  500. for i,v in pairs(sounddata) do
  501. pcall(function()
  502. v["Sound"].PlaybackSpeed = v["Speed"]
  503. end)
  504. end
  505. for i,v in pairs(connections) do
  506. pcall(function()
  507. v:disconnect()
  508. end)
  509. end
  510. connections = {}
  511. pcall(function()
  512. dcon2:disconnect()
  513. end)
  514. humanoiddata = {}
  515. end
  516. end
  517. end)
  518. addattack(Enum.KeyCode.F, function()
  519. if not timestop and not timefast and not reversing then
  520. local p = Instance.new("Part")
  521. p.Anchored = true
  522. p.Material = "Glass"
  523. p.Size = Vector3.new(0.1,0.1,0.1)
  524. p.BrickColor = BrickColor.new("Toothpaste")
  525. p.CanCollide = false
  526. p.CFrame = char.HumanoidRootPart.CFrame
  527. local m = Instance.new("SpecialMesh")
  528. local cor = Instance.new("ColorCorrectionEffect")
  529. cor.Name = "slowcor"
  530. cor.Parent = game:GetService('Lighting')
  531. spawn(function()
  532. for i = 1, 20 do
  533. pcall(function()
  534. swait()
  535. table.insert(bodymoverdata, {Mover = v, Vel = v.Velocity})
  536. end)
  537. end
  538. end)
  539. if v:IsA("BodyPosition") then
  540. table.insert(bodymoverdata, {Mover = v, Vel = v.P})
  541. end
  542. dcon2 = workspace.DescendantAdded:connect(function(v)
  543. swait(2)
  544. if v:IsA("Humanoid") then
  545. table.insert(humanoiddata, {Hum = v, WS = v.WalkSpeed, JP = v.JumpPower})
  546. for _,track in pairs(v:GetPlayingAnimationTracks()) do
  547. Mover = v
  548. Vel = v.P
  549. end
  550. if v.Name == "HumanoidRootPart" and v:IsA("BasePart") then
  551. end
  552. if v:IsA("Sound") and v.Name ~= "dont" then
  553. table.insert(sounddata, {Sound = v, Speed = v.PlaybackSpeed})
  554. end
  555. end
  556. end)
  557. else
  558. local cor = game:GetService('Lighting'):FindFirstChild("slowcor")
  559. if cor then
  560. spawn(function()
  561. pcall(function()
  562. cor:Destroy()
  563. end)
  564. end)
  565. end
  566. timeslow = false
  567. soundeffect(soundlist.TimeResume, 1.5, 1, char)
  568. pcall(function()
  569. if v["Mover"]:IsA("BodyVelocity") then
  570. v["Mover"].Velocity = v["Vel"]
  571. end
  572. end)
  573. connections = {}
  574. pcall(function()
  575. dcon2:disconnect()
  576. end)
  577. humanoiddata = {}
  578. end
  579. end)
  580. local reversedata = {}
  581. local saved = false
  582. addattack(Enum.KeyCode.C, function()
  583. if not timestop and not timeslow and not timefast then
  584. if not saved then
  585. saved = true
  586. for i,v in pairs(workspace:GetDescendants()) do
  587. -- }a)
  588. end
  589. end
  590. else
  591. reversing = true
  592. saved = false
  593. soundeffect(soundlist.TimeReverse, 2, 1, workspace)
  594. for i = 1, 10 do
  595. for _,v in pairs(reversedata) do
  596. local obj = v.obj
  597. local cf = v.cf
  598. obj.Anchored = true
  599. swait()
  600. end
  601. char.HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  602. reversedata = {}
  603. reversing = false
  604. end
  605. end
  606. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement