Advertisement
WagnerJunio07

Supr14's Visualizer FE

Apr 24th, 2019
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.77 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  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,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. --Draw something, put your sound id in, and watch the light show!--
  88. --Enjoy lads.--
  89. Player=owner
  90. Character=Player.Character
  91. Character.Humanoid.Name = "noneofurbusiness"
  92. hum = Character.noneofurbusiness
  93. LeftArm=Character["Left Arm"]
  94. LeftLeg=Character["Left Leg"]
  95. RightArm=Character["Right Arm"]
  96. RightLeg=Character["Right Leg"]
  97. Root=Character["HumanoidRootPart"]
  98. Head=Character["Head"]
  99. Torso=Character["Torso"]
  100. Neck=Torso["Neck"]
  101. removeuseless = game:GetService("Debris")
  102. soundIsPlaying = false
  103. number = 0
  104. stop = false
  105. flatt = false
  106. standingg = true
  107. tf = 0
  108. idrewsomething = false
  109. tab2={}
  110. tab={}
  111. blue = false
  112. red = true
  113. green = false
  114. drawingallowed = true
  115. MseGuide = true
  116. RunSrv = game:GetService("RunService")
  117.  
  118. local HEADLERP = Instance.new("ManualWeld")
  119. HEADLERP.Parent = Head
  120. HEADLERP.Part0 = Head
  121. HEADLERP.Part1 = Head
  122. HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  123.  
  124. OrgnC0 = Neck.C0
  125. local movelimbs = coroutine.wrap(function()
  126. while RunSrv.RenderStepped:wait() do
  127. TrsoLV = Torso.CFrame.lookVector
  128. Dist = nil
  129. Diff = nil
  130. if not MseGuide then
  131. print("l")
  132. else
  133. local _, Point = Workspace:FindPartOnRay(Ray.new(Head.CFrame.p, mouse.Hit.lookVector), Workspace, false, true)
  134. Dist = (Head.CFrame.p-Point).magnitude
  135. Diff = Head.CFrame.Y-Point.Y
  136. local _, Point2 = Workspace:FindPartOnRay(Ray.new(LeftArm.CFrame.p, mouse.Hit.lookVector), Workspace, false, true)
  137. Dist2 = (LeftArm.CFrame.p-Point).magnitude
  138. Diff2 = LeftArm.CFrame.Y-Point.Y
  139. HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  140. Neck.C0 = Neck.C0:lerp(OrgnC0*CFrame.Angles((math.tan(Diff/Dist)*1), 0, (((Head.CFrame.p-Point).Unit):Cross(Torso.CFrame.lookVector)).Y*1), .1)
  141. end
  142. end
  143. end)
  144. movelimbs()
  145.  
  146. godmode = coroutine.wrap(function()---- so you don't get killed by fucking random things
  147. while true do
  148. hum.MaxHealth = math.huge
  149. wait(0.0000001)
  150. hum.Health = math.huge
  151. wait()
  152. end
  153. end)
  154. godmode()
  155. ff = Instance.new("ForceField", Character)
  156. ff.Visible = false
  157.  
  158. coroutine.wrap(function()
  159. mouse.Button1Down:connect(function()
  160. if drawingallowed then
  161. fo = false
  162. while true do
  163. if fo then break end
  164. idrewsomething = true
  165. brick = Instance.new("Part",Character)
  166. brick.Anchored = true
  167. brick.Material = "Neon"
  168. brick.CanCollide = false
  169. brick.BrickColor = BrickColor.new("Really black")
  170. brick.Size = Vector3.new(1,1,1)
  171. brick.CFrame = CFrame.new(mouse.Hit.p)
  172. table.insert(tab2,brick)
  173. light = Instance.new("PointLight", brick)
  174. light.Color = brick.BrickColor.Color
  175. light.Range = 0
  176. light.Enabled = true
  177. light.Shadows = true
  178. light.Brightness = 0
  179. table.insert(tab,light)
  180. wait()
  181. end
  182. end
  183. end)
  184. end)()
  185.  
  186. coroutine.wrap(function()
  187. mouse.Button1Up:connect(function()
  188. if drawingallowed then
  189. fo = true
  190. end
  191. end)
  192. end)()
  193.  
  194. ---GUI---
  195.  
  196. screenGui = Instance.new("ScreenGui")
  197. screenGui.Parent = script.Parent
  198.  
  199. frame = Instance.new("Frame")
  200. frame.Parent = screenGui
  201. frame.Position = UDim2.new(0, 8, 0, 225)
  202. frame.Size = UDim2.new(0, 250, 0, 200)
  203. frame.BackgroundColor3 = BrickColor.new("White").Color
  204. frame.BackgroundTransparency = .5
  205.  
  206. textButton = Instance.new("TextButton")
  207. textButton.Parent = screenGui
  208. textButton.Position = UDim2.new(0, 12, 0, 400)
  209. textButton.Size = UDim2.new(0, 50, 0, 10)
  210. textButton.BackgroundColor3 = BrickColor.new("Really red").Color
  211. textButton.Text = "Red"
  212.  
  213. textButton.MouseButton1Down:connect(function()
  214. red = true
  215. green = false
  216. blue = false
  217. rainbow = false
  218. smooth = false
  219. end)
  220.  
  221. textButton2 = Instance.new("TextButton")
  222. textButton2.Parent = screenGui
  223. textButton2.Position = UDim2.new(0, 75, 0, 400)
  224. textButton2.Size = UDim2.new(0, 50, 0, 10)
  225. textButton2.BackgroundColor3 = BrickColor.new("Really blue").Color
  226. textButton2.Text = "Blue"
  227.  
  228. textButton2.MouseButton1Down:connect(function()
  229. red = false
  230. green = false
  231. blue = true
  232. rainbow = false
  233. smooth = false
  234. end)
  235.  
  236. textButton3 = Instance.new("TextButton")
  237. textButton3.Parent = screenGui
  238. textButton3.Position = UDim2.new(0, 138, 0, 400)
  239. textButton3.Size = UDim2.new(0, 50, 0, 10)
  240. textButton3.BackgroundColor3 = BrickColor.new("Lime green").Color
  241. textButton3.Text = "Green"
  242.  
  243. textButton3.MouseButton1Down:connect(function()
  244. red = false
  245. green = true
  246. blue = false
  247. rainbow = false
  248. smooth = false
  249. end)
  250.  
  251. textButton4 = Instance.new("TextButton")
  252. textButton4.Parent = screenGui
  253. textButton4.Position = UDim2.new(0, 201, 0, 400)
  254. textButton4.Size = UDim2.new(0, 50, 0, 10)
  255. coroutine.wrap(function()
  256. while true do
  257. textButton4.BackgroundColor3 = BrickColor.Random().Color
  258. wait(.05)
  259. end
  260. end)()
  261. textButton4.Text = "Rainbow"
  262.  
  263. textButton4.MouseButton1Down:connect(function()
  264. red = false
  265. green = false
  266. blue = false
  267. rainbow = true
  268. smooth = false
  269. end)
  270.  
  271. textBox = Instance.new("TextBox")
  272. textBox.Parent = screenGui
  273. textBox.Position = UDim2.new(0, 58, 0, 280)
  274. textBox.Size = UDim2.new(0, 150, 0, 20)
  275. textBox.BackgroundColor3 = BrickColor.new("White").Color
  276. textBox.Text = "Type Sound Id here"
  277.  
  278. form = Instance.new("TextButton")
  279. form.Parent = screenGui
  280. form.TextScaled = true
  281. form.Position = UDim2.new(0, 114, 0, 305)
  282. form.Size = UDim2.new(0, 40, 0, 20)
  283. form.BackgroundColor3 = BrickColor.new("White").Color
  284. form.Text = "Up"
  285.  
  286. form.MouseButton1Down:connect(function()
  287. if standingg then
  288. standingg = false
  289. flatt = true
  290. form.Text = "Flat"
  291. elseif flatt then
  292. flatt = false
  293. standingg = true
  294. form.Text = "Up"
  295. end
  296. end)
  297.  
  298. coroutine.wrap(function()
  299. while wait() do
  300. sid = textBox.Text
  301. end
  302. end)()
  303.  
  304. playbutton = Instance.new("TextButton")
  305. playbutton.Parent = screenGui
  306. playbutton.Position = UDim2.new(0, 58, 0, 305)
  307. playbutton.Size = UDim2.new(0, 50, 0, 20)
  308. playbutton.BackgroundColor3 = BrickColor.new("White").Color
  309. playbutton.Text = "Play"
  310.  
  311. playbutton.MouseButton1Down:connect(function()
  312. if not idrewsomething then return end
  313. if soundIsPlaying then
  314. sound1:Remove()
  315. sound1 = Instance.new("Sound", Character)
  316. sound1.Looped = true
  317. sound1.SoundId = "http://www.roblox.com/asset/?id=" .. sid
  318. sound1:Play()
  319. else
  320. soundIsPlaying = true
  321. vol.Text = 1
  322. pitch.Text = 1
  323. sound1 = Instance.new("Sound", Character)
  324. coroutine.wrap(function()
  325. while soundIsPlaying do
  326. wait()
  327. sound1.Volume = svol
  328. end
  329. end)()
  330. sound1.Looped = true
  331. coroutine.wrap(function()
  332. while soundIsPlaying do
  333. sound1.Pitch = pitchh
  334. wait()
  335. end
  336. end)()
  337. sound1.SoundId = "http://www.roblox.com/asset/?id=" .. sid
  338. sound1:Play()
  339. coroutine.wrap(function()
  340. while sound1.IsPlaying and soundIsPlaying do
  341. for i,v in pairs(tab) do
  342. v.Enabled = true
  343. v.Brightness = sound1.PlaybackLoudness/19
  344. v.Range = sound1.PlaybackLoudness/15
  345. if red then
  346. v.Color = Color3.new(sound1.PlaybackLoudness/200, 0,0)
  347. elseif blue then
  348. v.Color = Color3.new(0, 0,sound1.PlaybackLoudness/200)
  349. elseif green then
  350. v.Color = Color3.new(0, sound1.PlaybackLoudness/200,0)
  351. elseif rainbow then
  352. v.Color = brick.BrickColor.Color
  353. end
  354. end
  355. wait()
  356. end
  357. end)()
  358. while sound1.IsPlaying and soundIsPlaying do
  359. workspace.CurrentCamera.FieldOfView = 70 - sound1.PlaybackLoudness/100
  360. bcol = brick.BrickColor
  361. for _,v in pairs(tab2) do
  362. if standingg then
  363. v.Size = Vector3.new(1, sound1.PlaybackLoudness/math.random(10,25), 1)
  364. elseif flatt then
  365. v.Size = Vector3.new(sound1.PlaybackLoudness/math.random(10,25), 1, 1)
  366. end
  367. if red then
  368. v.BrickColor = BrickColor.new(Color3.new(sound1.PlaybackLoudness/200, 0,0))
  369. elseif blue then
  370. v.BrickColor = BrickColor.new(Color3.new(0,0,sound1.PlaybackLoudness/200))
  371. elseif green then
  372. v.BrickColor = BrickColor.new(Color3.new(0,sound1.PlaybackLoudness/200,0))
  373. elseif rainbow then
  374. v.BrickColor = BrickColor.Random()
  375. end
  376. end
  377. wait()
  378. end
  379. end
  380. end)
  381.  
  382. local stopbutton = Instance.new("TextButton")
  383. stopbutton.Parent = screenGui
  384. stopbutton.Position = UDim2.new(0, 158, 0, 305)
  385. stopbutton.Size = UDim2.new(0, 50, 0, 20)
  386. stopbutton.BackgroundColor3 = BrickColor.new("White").Color
  387. stopbutton.Text = "Stop"
  388.  
  389. vol = Instance.new("TextBox")
  390. vol.Parent = screenGui
  391. vol.Position = UDim2.new(0, 58, 0, 330)
  392. vol.Size = UDim2.new(0, 50, 0, 20)
  393. vol.BackgroundColor3 = BrickColor.new("White").Color
  394. vol.Text = "Volume"
  395.  
  396. coroutine.wrap(function()
  397. while wait() do
  398. svol = vol.Text
  399. end
  400. end)()
  401.  
  402. local remove = Instance.new("TextButton")
  403. remove.Parent = screenGui
  404. remove.Position = UDim2.new(0, 108, 0, 370)
  405. remove.Size = UDim2.new(0, 50, 0, 20)
  406. remove.BackgroundColor3 = BrickColor.new("White").Color
  407. remove.Text = "Clean"
  408.  
  409. pitch = Instance.new("TextBox")
  410. pitch.Parent = screenGui
  411. pitch.Position = UDim2.new(0, 158, 0, 330)
  412. pitch.Size = UDim2.new(0, 50, 0, 20)
  413. pitch.BackgroundColor3 = BrickColor.new("White").Color
  414. pitch.Text = "Pitch"
  415.  
  416. coroutine.wrap(function()
  417. while wait() do
  418. pitchh = pitch.Text
  419. end
  420. end)()
  421.  
  422. pitchup = Instance.new("ImageButton")
  423. pitchup.Parent = screenGui
  424. pitchup.Position = UDim2.new(0, 131, 0, 327)
  425. pitchup.BackgroundTransparency = 1
  426. pitchup.Size = UDim2.new(0, 25, 0, 25)
  427. pitchup.Image = "rbxassetid://29563813"
  428.  
  429. pitchup.MouseButton1Down:connect(function()
  430. if soundIsPlaying then
  431. pitch.Text = pitch.Text + .1
  432. end
  433. end)
  434.  
  435. pitchdown = Instance.new("ImageButton")
  436. pitchdown.Parent = screenGui
  437. pitchdown.Rotation = 180
  438. pitchdown.Position = UDim2.new(0, 211, 0, 327)
  439. pitchdown.BackgroundTransparency = 1
  440. pitchdown.Size = UDim2.new(0, 25, 0, 25)
  441. pitchdown.Image = "rbxassetid://29563813"
  442.  
  443. pitchdown.MouseButton1Down:connect(function()
  444. if soundIsPlaying then
  445. pitch.Text = pitch.Text - .1
  446. end
  447. end)
  448.  
  449. remove.MouseButton1Down:connect(function()
  450. if idrewsomething then
  451. if soundIsPlaying then
  452. soundIsPlaying = false
  453. workspace.CurrentCamera.FieldOfView = 70
  454. woosh = Instance.new("Sound",Character)
  455. woosh.Volume = 2
  456. woosh.SoundId = "rbxasstid://215402014"
  457. woosh:Play()
  458. sound1:Stop()
  459. pitch.Text = "Pitch"
  460. vol.Text = "Volume"
  461. removeuseless:AddItem(woosh,2)
  462. for _,v in pairs(tab2) do
  463. v:Remove()
  464. end
  465. idrewsomething = false
  466. elseif not soundIsPlaying then
  467. soundIsPlaying = false
  468. woosh = Instance.new("Sound",Character)
  469. woosh.Volume = 2
  470. woosh.SoundId = "rbxasstid://215402014"
  471. woosh:Play()
  472. for _,v in pairs(tab2) do
  473. v:Remove()
  474. end
  475. idrewsomething = false
  476. end
  477. end
  478. end)
  479.  
  480. local day = Instance.new("TextButton")
  481. day.Parent = screenGui
  482. day.Position = UDim2.new(0, 50, 0, 370)
  483. day.Size = UDim2.new(0, 50, 0, 20)
  484. day.BackgroundColor3 = BrickColor.new("Bright yellow").Color
  485. day.Text = "Day"
  486.  
  487. day.MouseButton1Down:connect(function()
  488. daytime = true
  489. nighttime = false
  490. turnon = Instance.new("Sound",Character)
  491. turnon.SoundId = "rbxassetid://858896518"
  492. turnon.Volume = 1
  493. turnon.Pitch = 1.05
  494. turnon:Play()
  495. removeuseless:AddItem(turnon,2)
  496. coroutine.wrap(function()
  497. while daytime do
  498. game.Lighting.TimeOfDay = 12
  499. game.Lighting.GlobalShadows = true
  500. game.Lighting.Ambient = Color3.fromRGB(10,10,10)
  501. game.Lighting.Brightness = 1
  502. wait()
  503. end
  504. end)()
  505. end)
  506.  
  507. local night = Instance.new("TextButton")
  508. night.Parent = screenGui
  509. night.Position = UDim2.new(0, 165, 0, 370)
  510. night.Size = UDim2.new(0, 50, 0, 20)
  511. night.BackgroundColor3 = BrickColor.new("Really black").Color
  512. night.TextColor = BrickColor.new("White")
  513. night.Text = "Night"
  514.  
  515. night.MouseButton1Down:connect(function()
  516. daytime = false
  517. nighttime = true
  518. turnoff = Instance.new("Sound",Character)
  519. turnoff.SoundId = "rbxassetid://858896518"
  520. turnoff.Volume = 1
  521. turnoff.Pitch = .9
  522. turnoff:Play()
  523. removeuseless:AddItem(turnoff,2)
  524. coroutine.wrap(function()
  525. while nighttime do
  526. game.Lighting.TimeOfDay = 0
  527. game.Lighting.GlobalShadows = false
  528. game.Lighting.Ambient = Color3.new(0,0,0)
  529. game.Lighting.Brightness = 0
  530. wait()
  531. end
  532. end)()
  533. end)
  534.  
  535. volumeup = Instance.new("ImageButton")
  536. volumeup.Parent = screenGui
  537. volumeup.Position = UDim2.new(0, 29, 0, 327)
  538. volumeup.BackgroundTransparency = 1
  539. volumeup.Size = UDim2.new(0, 25, 0, 25)
  540. volumeup.Image = "rbxassetid://29563813"
  541.  
  542. volumeup.MouseButton1Down:connect(function()
  543. if soundIsPlaying then
  544. vol.Text = vol.Text + 1
  545. end
  546. end)
  547.  
  548. volumedown = Instance.new("ImageButton")
  549. volumedown.Parent = screenGui
  550. volumedown.Rotation = 180
  551. volumedown.Position = UDim2.new(0, 111, 0, 327)
  552. volumedown.BackgroundTransparency = 1
  553. volumedown.Size = UDim2.new(0, 25, 0, 25)
  554. volumedown.Image = "rbxassetid://29563813"
  555.  
  556. Supr14 = Instance.new("ImageLabel")
  557. Supr14.Parent = screenGui
  558. Supr14.Rotation = 0
  559. Supr14.Position = UDim2.new(0, 13, 0, 222)
  560. Supr14.BackgroundTransparency = 1
  561. Supr14.Size = UDim2.new(0, 240, 0, 60)
  562. Supr14.Image = "rbxassetid://1815697653"
  563.  
  564. volumedown.MouseButton1Down:connect(function()
  565. if soundIsPlaying then
  566. vol.Text = vol.Text - 1
  567. end
  568. end)
  569.  
  570. stopbutton.MouseButton1Down:connect(function()
  571. if idrewsomething then
  572. if soundIsPlaying then
  573. sound1:Remove()
  574. soundIsPlaying = false
  575. workspace.CurrentCamera.FieldOfView = 70
  576. pitch.Text = "Pitch"
  577. vol.Text = "Volume"
  578. for i,v in pairs(tab) do
  579. v.Enabled = false
  580. end
  581. for i = 1, 10 do
  582. for _,v in pairs(tab2) do
  583. v.BrickColor = BrickColor.new("Really black")
  584. v.Size = v.Size - Vector3.new(0,15,0)
  585. end
  586. wait()
  587. end
  588. end
  589. end
  590. end)
  591.  
  592. print("Drawing visualiser!, Made by Supr14")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement