Advertisement
DatOneTrap

Untitled

May 6th, 2020
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.91 KB | None | 0 0
  1. --[[ Player Functions ]]--
  2.  
  3. plr = game:GetService("Players").LUCAS_KENJK2
  4. char = plr.Character
  5.  
  6. --[[ Color Functions ]]--
  7.  
  8. local h = math.random(0, 100)
  9. local color = Color3.fromHSV(h / 100, 1, 0.9)
  10. local lastbeat = 0
  11. local lastloud = 0
  12. local PlaybackSound = 0
  13.  
  14. --[[ Settings ]]--
  15.  
  16. local distance = 5
  17.  
  18. local Settings = {
  19. Parts = 0
  20. }
  21.  
  22. --[[ Folder ]]--
  23.  
  24. local visuals = Instance.new("Folder")
  25. visuals.Parent = char
  26.  
  27. local visuals2 = Instance.new("Folder")
  28. visuals2.Parent = char
  29.  
  30. --[[ Sound ]]--
  31.  
  32. local sound = Instance.new("Sound")
  33. sound.SoundId = "rbxassetid://3177379746"
  34. sound.Parent = char["HumanoidRootPart"]
  35. sound.Volume = 3
  36. sound.Name = "Music"
  37. sound.Looped = true
  38. sound:Play()
  39.  
  40. plr.Chatted:connect(function(msg)
  41.  
  42. if msg:sub(1, 7):lower()=='/e play' then
  43. local val = Instance.new("NumberValue", char)
  44. val.Value = tonumber(msg:sub(8))
  45. local id = val.Value
  46. sound:Stop()
  47. sound.SoundId = 'rbxassetid://'..id
  48. sound:Play()
  49. sound.Looped = true
  50.  
  51. elseif msg:sub(1, 8):lower()=='/e pitch' then
  52. local val2 = Instance.new("NumberValue", char)
  53. val2.Value = tonumber(msg:sub(9))
  54. local Pitch = val2.Value
  55. sound.Pitch = Pitch
  56.  
  57. elseif msg:sub(1, 6):lower()=='/e vol' then
  58. local val3 = Instance.new("NumberValue", char)
  59. val3.Value = tonumber(msg:sub(7))
  60. local Volume = val3.Value
  61. sound.Volume = Volume
  62.  
  63. elseif msg:sub(1, 7):lower()=='/e part' then
  64. Part(tonumber(msg:sub(8)))
  65.  
  66. elseif msg:sub(1, 7):lower()=='/e dist' then
  67. local val4 = Instance.new("NumberValue", char)
  68. val4.Value = tonumber(msg:sub(8))
  69. local dist = val4.Value
  70. distance = dist
  71.  
  72. end
  73.  
  74. end)
  75.  
  76. --[[ Cloud ]]--
  77.  
  78. local cloud = Instance.new("Part")
  79. cloud.Anchored = true
  80. cloud.CanCollide = false
  81. cloud.Locked = true
  82. cloud.Size = Vector3.new(1, 1, 1)
  83. cloud.Color = Color3.new(0, 0, 0)
  84. cloud.Material = Enum.Material.ForceField
  85. cloud.Parent = char
  86. cloud.CFrame = char["HumanoidRootPart"].CFrame
  87.  
  88. local cloudm = Instance.new("SpecialMesh")
  89. cloudm.MeshType = Enum.MeshType.FileMesh
  90. cloudm.MeshId = "rbxassetid://1095708"
  91. cloudm.TextureId = "rbxassetid://607077972"
  92. cloudm.Parent = cloud
  93.  
  94. --[[ Snow ]]--
  95.  
  96. local snowpart = Instance.new("Part")
  97. snowpart.Anchored = true
  98. snowpart.CanCollide = false
  99. snowpart.Locked = true
  100. snowpart.Transparency = 1
  101. snowpart.Size = Vector3.new(25, 0.05, 25)
  102. snowpart.Parent = char
  103. snowpart.CFrame = char["HumanoidRootPart"].CFrame
  104.  
  105. local snow = Instance.new("ParticleEmitter")
  106. snow.Texture = "rbxassetid://381055267"
  107. snow.LightInfluence = 1
  108. snow.Parent = snowpart
  109.  
  110. --[[ Parts ]]--
  111.  
  112. local Parts = {}
  113.  
  114. function Part(Num)
  115.  
  116. Settings.Parts = Num
  117.  
  118. for i, v in pairs(visuals2:GetChildren()) do
  119. v:Destroy()
  120. end
  121.  
  122. for i = 1, Num do
  123.  
  124. local Partz = Instance.new('Part')
  125. Partz.Anchored = true
  126. Partz.CanCollide = false
  127. Partz.Locked = true
  128. Partz.Material = Enum.Material.Neon
  129. Partz.Size = Vector3.new(0, 0, 0)
  130. Partz.Parent = visuals2
  131. Partz.CFrame = char["HumanoidRootPart"].CFrame
  132. table.insert(Parts, Partz)
  133. end
  134. end
  135.  
  136. Part(15)
  137.  
  138. --[[ Remote ]]--
  139.  
  140. local Remote = Instance.new("RemoteEvent", char)
  141. Remote.Name = "Event"
  142.  
  143. --[[ Visual ]]--
  144.  
  145. local speed = 3
  146. local num = 0
  147. local change = 2 / speed
  148.  
  149. local Orbit = 0
  150.  
  151. local SelectedPart = 0
  152.  
  153. Remote.OnServerEvent:connect(function(plr, Playback)
  154.  
  155. num = num + change
  156. Orbit = Orbit + 0.25 + Playback/2500
  157.  
  158. local beat = math.abs(PlaybackSound - lastloud)
  159. if beat > lastbeat then
  160. lastbeat = beat
  161. else
  162. lastbeat = lastbeat - 10
  163. if lastbeat < 0 then
  164. lastbeat = 0
  165. end
  166. end
  167.  
  168. h = (h + beat / 250) % 100
  169. lastloud = PlaybackSound
  170.  
  171. local circumference = 5 * Settings.Parts
  172. local radius = circumference / (math.pi * distance)
  173.  
  174. snowpart.CFrame = snowpart.CFrame:lerp(char["HumanoidRootPart"].CFrame * CFrame.new(0, -3, 0) * CFrame.Angles(0, Orbit / 5, 0), 1 / speed)
  175.  
  176. snow.Speed = NumberRange.new(5 + Playback/1000)
  177. snow.Rate = 100 + Playback/1000
  178. snow.Lifetime = NumberRange.new(2.5 + Playback/1000)
  179. snow.Drag = 2 - Playback/100
  180. snow.Acceleration = Vector3.new(0, -5 - Playback/1000, 0)
  181. snow.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0 + Playback/1000), NumberSequenceKeypoint.new(1, 0.25 + Playback/1000)})
  182. snow.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.5, 0.5), NumberSequenceKeypoint.new(1, 1)})
  183. snow.Color = ColorSequence.new(Color3.new(1, 1, 1), Color3.fromHSV(h / 100, 1, 1))
  184. snow.RotSpeed = NumberRange.new(0 - sound.PlaybackLoudness/-250, 0 + sound.PlaybackLoudness/250)
  185. snow.SpreadAngle = Vector2.new(-25 - sound.PlaybackLoudness/-25, 25 + sound.PlaybackLoudness/25)
  186. snow.Rotation = NumberRange.new(-25 - Playback, 10 + Playback)
  187. snow.RotSpeed = NumberRange.new(-25 - Playback, 10 + Playback)
  188.  
  189. cloud.CFrame = cloud.CFrame:lerp(char["HumanoidRootPart"].CFrame * CFrame.new(0, 5 + math.cos(num / 25), 0) * CFrame.Angles(0.25 * (math.cos(num / 25) * math.cos(Playback/1000)), 0, 0.25 * (math.cos(num / 25) * math.cos(Playback/1000))), 1 / speed)
  190.  
  191. cloud.Color = cloud.Color:lerp(Color3.fromHSV(h / 100, 1, 1), 1 / speed)
  192.  
  193. cloudm.Scale = cloudm.Scale:lerp(Vector3.new(1 + Playback/250, 1 + Playback/250, 1 + Playback/250), 1 / speed)
  194.  
  195. if Playback >= 425 then
  196.  
  197. for i = 1, 1 do
  198.  
  199. local cloud2 = Instance.new("Part")
  200. cloud2.Anchored = true
  201. cloud2.CanCollide = false
  202. cloud2.Locked = true
  203. cloud2.Size = Vector3.new(1, 1, 1)
  204. cloud2.Color = Color3.fromHSV(h / 100, 1, 1)
  205. cloud2.Material = Enum.Material.ForceField
  206. cloud2.Parent = visuals
  207. cloud2.CFrame = cloud.CFrame
  208.  
  209. local cloudm2 = Instance.new("SpecialMesh")
  210. cloudm2.MeshType = Enum.MeshType.FileMesh
  211. cloudm2.MeshId = "rbxassetid://1095708"
  212. cloudm2.TextureId = "rbxassetid://607077972"
  213. cloudm2.Parent = cloud2
  214.  
  215. cloud2.Color = cloud2.Color:lerp(Color3.fromHSV(h / 100, 1, 1), 1 / speed)
  216.  
  217. cloud2.CFrame = cloud2.CFrame:lerp(cloud.CFrame * CFrame.new(0, 0, 0) * CFrame.Angles(math.random(-1, 1) * (math.cos(num / 25) / math.cos(Playback/math.random(750, 1000))), math.random(-1, 1) * (math.cos(num / 25) / math.cos(Playback/math.random(750, 1000))), math.random(-0.5, 0.5) * (math.cos(num / 25) / math.cos(Playback/math.random(750, 1000)))), 1 / speed)
  218.  
  219. pcall(function()
  220.  
  221. if Playback >= 100 then
  222.  
  223. for i = 1, 10 do
  224.  
  225. cloudm2.Scale = cloudm2.Scale:lerp(Vector3.new(cloudm.Scale.X + Playback/250, cloudm.Scale.Y + Playback/250, cloudm.Scale.Z + Playback/250), 1 / speed)
  226.  
  227. cloud2.Transparency = i / 10
  228.  
  229. wait()
  230.  
  231. end
  232.  
  233. else
  234.  
  235. radio2:Destroy()
  236.  
  237. mesh2:Destroy()
  238.  
  239. end
  240.  
  241. end)
  242.  
  243. end
  244.  
  245. end
  246.  
  247. for i,v in pairs(visuals2:GetChildren()) do
  248.  
  249. v.CFrame = v.CFrame:lerp(char["HumanoidRootPart"].CFrame * CFrame.Angles(0.25 * (math.cos(num / 25) * math.cos(Playback/1000)), math.rad(i * (360 / Settings.Parts) + Orbit), 0.25 * (math.cos(num / 15) * math.cos(Playback/1000))) * CFrame.new(0, (math.floor((i - 1)) + math.clamp(i, 0, 1)) + math.cos(num / 15), radius * 2), 1 / speed)
  250.  
  251. end
  252.  
  253. if SelectedPart < #Parts then
  254.  
  255. SelectedPart = SelectedPart + 1
  256.  
  257. else
  258.  
  259. SelectedPart = 1
  260.  
  261. end
  262.  
  263. local sel = Parts[SelectedPart]
  264.  
  265. sel.Size = sel.Size:lerp(Vector3.new(0.25 * radius, Playback/50 / radius, 0.25 * radius), 1 / speed)
  266. sel.Color = sel.Color:lerp(Color3.fromHSV(h / 100, 1, 1), 1 / speed)
  267. sel.Material = Enum.Material.Neon
  268.  
  269. PlaybackSound = Playback
  270.  
  271. end)
  272.  
  273. --[[ Debounce ]]--
  274.  
  275. function debounce(func)
  276. local isRunning = false
  277. return function(...)
  278. if not isRunning then
  279. isRunning = true
  280.  
  281. func(...)
  282.  
  283. isRunning = false
  284. end
  285. end
  286. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement