Advertisement
DatOneTrap

Untitled

May 6th, 2020
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. --[[ Player Functions ]]--
  2.  
  3. plr = game.Players:WaitForChild(_G.target)
  4. char = plr.Character
  5.  
  6. --[[ God Mode ]]--
  7.  
  8. forcefield = Instance.new("ForceField", char)
  9. forcefield.Visible = false
  10.  
  11. char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
  12.  
  13. --[[ Color Functions ]]--
  14.  
  15. h = math.random(0, 100)
  16. color = Color3.fromHSV(h / 100, 1, 0.9)
  17. lastbeat = 0
  18. lastloud = 0
  19.  
  20. --[[ Light ]]--
  21.  
  22. local lite = Instance.new("PointLight")
  23. lite.Range = 0
  24. lite.Brightness = 0
  25. lite.Parent = char.HumanoidRootPart
  26.  
  27. --[[ Sound ]]--
  28.  
  29. local sound = Instance.new("Sound")
  30. sound.Parent = char.HumanoidRootPart
  31. sound.Volume = 10
  32. sound.Name = "Music"
  33. sound.Looped = true
  34.  
  35. plr.Chatted:connect(function(msg)
  36. if msg:sub(1, 6):lower()=='visual' then
  37. local val = Instance.new("NumberValue", char)
  38. val.Value = tonumber(msg:sub(7))
  39. local id = val.Value
  40. sound:Stop()
  41. sound.MaxDistance = 500
  42. sound.SoundId='rbxassetid://'..id
  43. sound:Play()
  44. sound.Looped = true
  45. wait()
  46. elseif msg:sub(1,5):lower()=='pitch' then
  47. local val2 = Instance.new("NumberValue", char)
  48. val2.Value = tonumber(msg:sub(6))
  49. local Pitch = val2.Value
  50. sound.Pitch = Pitch
  51. elseif msg:sub(1,3):lower()=='vol' then
  52. local val3 = Instance.new("NumberValue", char)
  53. val3.Value = tonumber(msg:sub(5))
  54. local Volume = val3.Value
  55. sound.Volume = Volume
  56. end
  57. end)
  58.  
  59. --[[ Remote ]]--
  60.  
  61. local Remote = Instance.new("RemoteEvent", char)
  62. Remote.Name = "Event"
  63. local PlaybackSound = 0
  64.  
  65. --[[ Parts ]]--
  66.  
  67. Parts = {}
  68.  
  69. local Ball = Instance.new("Part", char)
  70. Ball.Size = Vector3.new(3, 3, 3)
  71. Ball.Shape = Enum.PartType.Ball
  72. Ball.Material = "Neon"
  73. Ball.Anchored = true
  74. Ball.CanCollide = false
  75. Ball.Locked = true
  76. Ball.Transparency = 0
  77. Ball.CFrame = char.HumanoidRootPart.CFrame
  78.  
  79. for i = 1, 10 do
  80. local part = Instance.new("Part")
  81. part.Size = Vector3.new(0.2, 0.2, 0.2)
  82. part.Material = "Neon"
  83. part.Anchored = true
  84. part.CanCollide = false
  85. part.Parent = Ball
  86. part.CFrame = Ball.CFrame
  87.  
  88. local mesh = Instance.new("BlockMesh")
  89. mesh.Parent = part
  90. mesh.Name = "Mesh"
  91.  
  92. table.insert(Parts, part)
  93. end
  94.  
  95. --[[ Visual ]]--
  96.  
  97. local Y = 0
  98. local X = 0
  99. local Z = 0
  100.  
  101. local SelectedPart = 0
  102.  
  103. Remote.OnServerEvent:connect(function(plr, Playback)
  104.  
  105. Y = Y + Playback/100000
  106. X = X + Playback/10000
  107. Z = Z + Playback/1000
  108.  
  109. local beat = math.abs(PlaybackSound - lastloud)
  110. if beat > lastbeat then
  111. lastbeat = beat
  112. else
  113. lastbeat = lastbeat - 10
  114. if lastbeat < 0 then
  115. lastbeat = 0
  116. end
  117. end
  118.  
  119. h = (h + beat / 250) % 100
  120. lastloud = PlaybackSound
  121. color = Color3.fromHSV(h / 100, 5, 0.5 + lastbeat / 50)
  122.  
  123. local circumference = Playback/750 * #Parts
  124. local answer = circumference / (math.pi * 10)
  125.  
  126. Ball.CFrame = Ball.CFrame:lerp(char.HumanoidRootPart.CFrame * CFrame.new(0, 5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(X),math.rad(Y),math.rad(Z)), 0.25)
  127. Ball.Size = Ball.Size:lerp(Vector3.new(Playback/250, Playback/250, Playback/250), 0.25)
  128.  
  129. for i,v in pairs(Parts) do
  130.  
  131. v.CFrame = v.CFrame:lerp(Ball.CFrame * CFrame.Angles(0 + X, math.rad(i*(360/#Parts)) + Y, 0 + Z) * CFrame.new(0, 0, answer + Playback/250), 0.5)
  132. v.Mesh.Scale = v.Mesh.Scale:lerp(Vector3.new(1, 1, 1), 0.25)
  133.  
  134. end
  135.  
  136. Ball.Color = Ball.Color:lerp(Color3.fromHSV(h / 100, 1, 1), 0.25)
  137.  
  138. if SelectedPart < #Parts then
  139. SelectedPart = SelectedPart + 1
  140. else
  141. SelectedPart = 1
  142. end
  143.  
  144. local sel = Parts[SelectedPart]
  145.  
  146. sel.Color = sel.Color:lerp(Color3.fromHSV(h / 100, 0.25, 0.25), 0.25)
  147. sel.Mesh.Scale = sel.Mesh.Scale:lerp(Vector3.new(Playback/100, Playback/100, Playback/5), 0.08)
  148.  
  149. wait(1)
  150.  
  151. sel.Color = sel.Color:lerp(Color3.fromHSV(h / 100, 1, 1), 0.25)
  152. sel.Mesh.Scale = sel.Mesh.Scale:lerp(Vector3.new(Playback/250, Playback/250, Playback/25), 0.08)
  153.  
  154. PlaybackSound = Playback
  155.  
  156. end)
  157.  
  158. --[[ Debounce ]]--
  159.  
  160. function debounce(func)
  161. local isRunning = false
  162. return function(...)
  163. if not isRunning then
  164. isRunning = true
  165.  
  166. func(...)
  167.  
  168. isRunning = false
  169. end
  170. end
  171. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement