Advertisement
KrYn0MoRe

visualiser

Aug 25th, 2018 (edited)
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.65 KB | None | 0 0
  1. local plr = owner
  2. repeat wait() until plr.Character
  3. local char = plr.Character
  4. local tors = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  5. local remote = Instance.new("RemoteEvent",script)
  6. remote.Name = "Remote"
  7. script.Parent = char
  8. script.Name = "coolvis"
  9. --script.Parent = game:GetService("ServerScriptService")
  10.  
  11. --------- SazEreno's Artificial HB --------------
  12. ArtificialHB = Instance.new("BindableEvent", script)
  13. ArtificialHB.Name = "ArtificialHB"
  14.  
  15. script:WaitForChild("ArtificialHB")
  16. Frame_Speed = 1 / 60
  17. frame = Frame_Speed
  18. tf = 0
  19. allowframeloss = false
  20. tossremainder = false
  21. lastframe = tick()
  22. script.ArtificialHB:Fire()
  23.  
  24. game:GetService("RunService").Heartbeat:connect(function(s, p)
  25.     tf = tf + s
  26.     if tf >= frame then
  27.         if allowframeloss then
  28.             script.ArtificialHB:Fire()
  29.             lastframe = tick()
  30.         else
  31.             for i = 1, math.floor(tf / frame) do
  32.                 script.ArtificialHB:Fire()
  33.             end
  34.         lastframe = tick()
  35.         end
  36.         if tossremainder then
  37.             tf = 0
  38.         else
  39.             tf = tf - frame * math.floor(tf / frame)
  40.         end
  41.     end
  42. end)
  43.  
  44. ------------------
  45. function swait(num)
  46. if num == 0 or num == nil then
  47.         ArtificialHB.Event:wait()
  48.     else
  49.         for i = 1, num do
  50.             ArtificialHB.Event:wait()
  51.         end
  52.     end
  53. end
  54.  
  55. local cube = Instance.new("Part",char)
  56. cube.Size = Vector3.new(3,3,3)
  57. cube.Anchored = true
  58. cube.CanCollide = false
  59. cube.Material = Enum.Material.Neon
  60. local cube2 = Instance.new("Part",char)
  61. cube2.Size = Vector3.new(3,3,3)
  62. cube2.Anchored = true
  63. cube2.CanCollide = false
  64. cube2.Material = Enum.Material.Neon
  65. local cube3 = Instance.new("Part",char)
  66. cube3.Size = Vector3.new(3,3,3)
  67. cube3.Anchored = true
  68. cube3.CanCollide = false
  69. cube3.Material = Enum.Material.Neon
  70. local cube4 = Instance.new("Part",char)
  71. cube4.Size = Vector3.new(3,3,3)
  72. cube4.Anchored = true
  73. cube4.CanCollide = false
  74. cube4.Material = Enum.Material.Neon
  75. --cube.Shape = Enum.PartType.Ball
  76.  
  77. local song = Instance.new("Sound",tors)
  78. song.Name = "KrY's Vis"
  79. --song.SoundId = "rbxassetid://"
  80. song.EmitterSize = 10
  81. song.Volume = 10
  82. song.Looped = true
  83.  
  84. --[[workspace.DescendantRemoving:Connect(function(obj)
  85. if obj.name == plr.Name then
  86. song.Parent = game:GetService("Workspace")
  87. cube.Parent = game:GetService("Workspace")
  88. cube2.Parent = game:GetService("Workspace")
  89. cube3.Parent = game:GetService("Workspace")
  90. cube4.Parent = game:GetService("Workspace")
  91. spawn(function()
  92. repeat wait() until plr.Character
  93. char = plr.Character
  94. tors = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  95. song.Parent = tors
  96. cube.Parent = char
  97. cube2.Parent = char
  98. cube3.Parent = char
  99. cube4.Parent = char
  100. end)
  101. end
  102. end)]]
  103.  
  104. --song:Play()
  105.  
  106. --[[local w1 = Instance.new("Weld")
  107. w1.Parent = tors
  108. w1.Part0 = tors
  109. w1.Part1 = cube
  110. w1.C0 = CFrame.new(-5,0,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))]]
  111.  
  112. sizing = false
  113. sizing2 = false
  114. sizing3 = false
  115. sizing4 = false
  116. originalrad = 0
  117. originalspot = 0
  118. loudness = 0
  119. speedness = 0
  120. mode = 5
  121. prefix = "/"
  122.  
  123. remote.OnServerEvent:Connect(function(plr,loud,speed)
  124. loudness = loud
  125. speedness = speed
  126. end)
  127.  
  128. codestuffs = [[
  129. local plr = owner
  130. repeat wait() until plr.Character
  131. local char = plr.Character
  132. script.Parent = char:FindFirstChild("coolvis")
  133. local tors = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  134. local rem = script.Parent:WaitForChild("Remote")
  135. local song = tors:WaitForChild("KrY's Vis")
  136.  
  137. spawn(function()
  138. game:GetService("RunService").RenderStepped:Connect(function()
  139. wait(.1)
  140. rem:FireServer(song.PlaybackLoudness,song.PlaybackSpeed)
  141. end)
  142. end)
  143. ]]
  144. NLS(codestuffs,script)
  145.  
  146. function resize(p,s,owo)
  147. if owo == 1 then
  148. spawn(function()
  149. if sizing == false then
  150. sizing = true
  151. p.Size = p.Size + Vector3.new(loudness/500,loudness/500,loudness/500)
  152. wait()
  153. p.Size = Vector3.new(s,s,s)
  154. sizing = false
  155. end
  156. end)
  157. elseif owo == 2 then
  158. spawn(function()
  159. if sizing2 == false then
  160. sizing2 = true
  161. p.Size = p.Size + Vector3.new(loudness/500,loudness/500,loudness/500)
  162. wait()
  163. p.Size = Vector3.new(s,s,s)
  164. sizing2 = false
  165. end
  166. end)
  167. elseif owo == 3 then
  168. spawn(function()
  169. if sizing3 == false then
  170. sizing3 = true
  171. p.Size = p.Size + Vector3.new(loudness/500,loudness/500,loudness/500)
  172. wait()
  173. p.Size = Vector3.new(s,s,s)
  174. sizing3 = false
  175. end
  176. end)
  177. elseif owo == 4 then
  178. spawn(function()
  179. if sizing4 == false then
  180. sizing4 = true
  181. p.Size = p.Size + Vector3.new(loudness/500,loudness/500,loudness/500)
  182. wait()
  183. p.Size = Vector3.new(s,s,s)
  184. sizing4 = false
  185. end
  186. end)
  187. else return end
  188. end
  189.  
  190. mrd1 = math.random(300,400)
  191. mrd2 = math.random(600,700)
  192. mrd3 = math.random(400,600)
  193.  
  194. function other(p)
  195. p.Color = Color3.new(loudness / mrd1,loudness / mrd2,loudness / mrd3)
  196. end
  197.  
  198. --[[spawn(function()
  199. while swait() do
  200. originalrad = originalrad + 1
  201. cube.CFrame = cube.CFrame*CFrame.Angles(originalrad,originalrad,originalrad)
  202. end
  203. end)]]
  204.  
  205. function repos(p,t,s1,s2,s3)
  206. originalrad = originalrad + ((speedness / 100) * (loudness / 100))
  207. p.CFrame = t.CFrame + Vector3.new(s1,s2,s3)
  208. if mode == 1 then
  209. p.CFrame = p.CFrame*CFrame.Angles(originalrad,0,originalrad)
  210. elseif mode == 2 then
  211. p.CFrame = p.CFrame*CFrame.Angles(originalrad,originalrad,originalrad)
  212. elseif mode == 3 then
  213. p.CFrame = p.CFrame*CFrame.Angles(originalrad,originalrad,0)
  214. elseif mode == 4 then
  215. p.CFrame = p.CFrame*CFrame.Angles(0,originalrad,originalrad)
  216. elseif mode == 5 then
  217. p.CFrame = p.CFrame*CFrame.Angles(0,originalrad,0)
  218. elseif mode == 6 then
  219. p.CFrame = p.CFrame*CFrame.Angles(0,0,originalrad)
  220. elseif mode == 6 then
  221. p.CFrame = p.CFrame*CFrame.Angles(originalrad,0,0)
  222. end
  223. p.CFrame = p.CFrame*CFrame.new(0,.75,0)
  224. end
  225.  
  226.  
  227.  
  228. --[[spawn(function()
  229. while wait(.1) do
  230. print((speedness / 100) * (loudness / 100))
  231. end
  232. end)
  233.  
  234. spawn(function()
  235. while wait(.1) do
  236. print(loudness)
  237. end
  238. end)]]
  239.  
  240. spawn(function()
  241. while true do
  242. swait()
  243. if song.IsPlaying == true and loudness > 10 then
  244. spawn(function()
  245. resize(cube,3,1)
  246. other(cube)
  247. end)
  248. spawn(function()
  249. resize(cube2,3,2)
  250. other(cube2)
  251. end)
  252. spawn(function()
  253. resize(cube3,3,3)
  254. other(cube3)
  255. end)
  256. spawn(function()
  257. resize(cube4,3,4)
  258. other(cube4)
  259. end)
  260. end
  261. if song.IsPlaying == false or loudness < 10 then
  262. cube.Size = Vector3.new(3,3,3)
  263. cube2.Size = Vector3.new(3,3,3)
  264. cube3.Size = Vector3.new(3,3,3)
  265. cube4.Size = Vector3.new(3,3,3)
  266. cube.CFrame = CFrame.Angles(0,0,0)
  267. cube2.CFrame = CFrame.Angles(0,0,0)
  268. cube3.CFrame = CFrame.Angles(0,0,0)
  269. cube4.CFrame = CFrame.Angles(0,0,0)
  270. end
  271. repos(cube,tors,5,0,0)
  272. repos(cube2,tors,0,0,-5)
  273. repos(cube3,tors,-5,0,0)
  274. repos(cube4,tors,0,0,5)
  275. end
  276. end)
  277.  
  278. plr.Chatted:Connect(function(msg)
  279. --
  280. if msg:lower():sub(1,4) == "vol" ..prefix then
  281. local choice = msg:sub(5)
  282. if tonumber(choice) then
  283. song.Volume = choice
  284. end
  285. end
  286. --
  287. if msg:lower():sub(1,7) == "/e vol" ..prefix then
  288. local choice = msg:sub(8)
  289. if tonumber(choice) then
  290. song.Volume = choice
  291. end
  292. end
  293. --
  294. if msg:lower():sub(1,5) == "loop" ..prefix then
  295. local choice = msg:sub(6)
  296. if choice == "false" then
  297. song.Looped = false
  298. elseif choice == "true" then
  299. song.Looped = true
  300. end
  301. end
  302. --
  303. if msg:lower():sub(1,8) == "/e loop" ..prefix then
  304. local choice = msg:sub(9)
  305. if choice == "false" then
  306. song.Looped = false
  307. elseif choice == "true" then
  308. song.Looped = true
  309. end
  310. end
  311. --
  312. if msg:lower():sub(1,5) == "play" ..prefix then
  313. local songidthing = msg:sub(6)
  314. if tonumber(songidthing) then
  315. song.SoundId = "rbxassetid://" ..songidthing
  316. song.TimePosition = 0
  317. song:Play()
  318. end
  319. end
  320. --
  321. if msg:lower():sub(1,8) == "/e play" ..prefix then
  322. local songidthing = msg:sub(9)
  323. if tonumber(songidthing) then
  324. song.SoundId = "rbxassetid://" ..songidthing
  325. song.TimePosition = 0
  326. song:Play()
  327. end
  328. end
  329. --
  330. if msg:lower():sub(1,5) == "stop" ..prefix then
  331. song:Stop()
  332. wait()
  333. cube.Size = Vector3.new(3,3,3)
  334. cube2.Size = Vector3.new(3,3,3)
  335. cube3.Size = Vector3.new(3,3,3)
  336. cube4.Size = Vector3.new(3,3,3)
  337. cube.CFrame = CFrame.Angles(0,0,0)
  338. cube2.CFrame = CFrame.Angles(0,0,0)
  339. cube3.CFrame = CFrame.Angles(0,0,0)
  340. cube4.CFrame = CFrame.Angles(0,0,0)
  341. end
  342. --
  343. if msg:lower():sub(1,8) == "/e stop" ..prefix then
  344. song:Stop()
  345. wait()
  346. cube.Size = Vector3.new(3,3,3)
  347. cube2.Size = Vector3.new(3,3,3)
  348. cube3.Size = Vector3.new(3,3,3)
  349. cube4.Size = Vector3.new(3,3,3)
  350. cube.CFrame = CFrame.Angles(0,0,0)
  351. cube2.CFrame = CFrame.Angles(0,0,0)
  352. cube3.CFrame = CFrame.Angles(0,0,0)
  353. cube4.CFrame = CFrame.Angles(0,0,0)
  354. end
  355. --
  356. if msg:lower():sub(1,6) == "pause" ..prefix then
  357. song:Pause()
  358. wait()
  359. cube.Size = Vector3.new(3,3,3)
  360. cube2.Size = Vector3.new(3,3,3)
  361. cube3.Size = Vector3.new(3,3,3)
  362. cube4.Size = Vector3.new(3,3,3)
  363. end
  364. --
  365. if msg:lower():sub(1,9) == "/e pause" ..prefix then
  366. song:Pause()
  367. wait()
  368. cube.Size = Vector3.new(3,3,3)
  369. cube2.Size = Vector3.new(3,3,3)
  370. cube3.Size = Vector3.new(3,3,3)
  371. cube4.Size = Vector3.new(3,3,3)
  372. end
  373. --
  374. if msg:lower():sub(1,7) == "resume" ..prefix then
  375. song:Resume()
  376. end
  377. --
  378. if msg:lower():sub(1,10) == "/e resume" ..prefix then
  379. song:Resume()
  380. end
  381. --
  382. if msg:lower():sub(1,6) == "speed" ..prefix then
  383. local choice = msg:lower():sub(7)
  384. if tonumber(choice) then
  385. song.PlaybackSpeed = tonumber(choice)
  386. end
  387. end
  388. --
  389. if msg:lower():sub(1,9) == "/e speed" ..prefix then
  390. local choice = msg:lower():sub(10)
  391. if tonumber(choice) then
  392. song.PlaybackSpeed = tonumber(choice)
  393. end
  394. end
  395. --
  396. if msg:lower():sub(1,6) == "style" ..prefix then
  397. local choice = msg:lower():sub(7)
  398. if --[[tonumber(choice) and]] (choice == "1" or choice == "2" or choice == "3" or choice == "4" or choice == "5" or choice == "6") then
  399. mode = tonumber(choice)
  400. end
  401. end
  402. --
  403. if msg:lower():sub(1,9) == "/e style" ..prefix then
  404. local choice = msg:lower():sub(10)
  405. if --[[tonumber(choice) and]] (choice == "1" or choice == "2" or choice == "3" or choice == "4" or choice == "5" or choice == "6") then
  406. mode = tonumber(choice)
  407. end
  408. end
  409. --
  410. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement