Advertisement
WagnerJunio07

Supr14's Visualizer FE (With RenderStepped)

Apr 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.83 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. RenderStepped = game:GetService("RunService").RenderStepped
  118.  
  119. local HEADLERP = Instance.new("ManualWeld")
  120. HEADLERP.Parent = Head
  121. HEADLERP.Part0 = Head
  122. HEADLERP.Part1 = Head
  123. HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  124.  
  125. OrgnC0 = Neck.C0
  126. local movelimbs = coroutine.wrap(function()
  127. while RunSrv.RenderStepped:wait() do
  128. TrsoLV = Torso.CFrame.lookVector
  129. Dist = nil
  130. Diff = nil
  131. if not MseGuide then
  132. print("l")
  133. else
  134. local _, Point = Workspace:FindPartOnRay(Ray.new(Head.CFrame.p, mouse.Hit.lookVector), Workspace, false, true)
  135. Dist = (Head.CFrame.p-Point).magnitude
  136. Diff = Head.CFrame.Y-Point.Y
  137. local _, Point2 = Workspace:FindPartOnRay(Ray.new(LeftArm.CFrame.p, mouse.Hit.lookVector), Workspace, false, true)
  138. Dist2 = (LeftArm.CFrame.p-Point).magnitude
  139. Diff2 = LeftArm.CFrame.Y-Point.Y
  140. HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  141. 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)
  142. end
  143. end
  144. end)
  145. movelimbs()
  146.  
  147. godmode = coroutine.wrap(function()---- so you don't get killed by fucking random things
  148. while true do
  149. hum.MaxHealth = math.huge
  150. wait(0.0000001)
  151. hum.Health = math.huge
  152. wait()
  153. end
  154. end)
  155. godmode()
  156. ff = Instance.new("ForceField", Character)
  157. ff.Visible = false
  158.  
  159. coroutine.wrap(function()
  160. mouse.Button1Down:connect(function()
  161. if drawingallowed then
  162. fo = false
  163. while true do
  164. if fo then break end
  165. idrewsomething = true
  166. brick = Instance.new("Part",Character)
  167. brick.Anchored = true
  168. brick.Material = "Neon"
  169. brick.CanCollide = false
  170. brick.BrickColor = BrickColor.new("Really black")
  171. brick.Size = Vector3.new(1,1,1)
  172. brick.CFrame = CFrame.new(mouse.Hit.p)
  173. table.insert(tab2,brick)
  174. light = Instance.new("PointLight", brick)
  175. light.Color = brick.BrickColor.Color
  176. light.Range = 0
  177. light.Enabled = true
  178. light.Shadows = true
  179. light.Brightness = 0
  180. table.insert(tab,light)
  181. wait()
  182. end
  183. end
  184. end)
  185. end)()
  186.  
  187. coroutine.wrap(function()
  188. mouse.Button1Up:connect(function()
  189. if drawingallowed then
  190. fo = true
  191. end
  192. end)
  193. end)()
  194.  
  195. ---GUI---
  196.  
  197. screenGui = Instance.new("ScreenGui")
  198. screenGui.Parent = script.Parent
  199.  
  200. frame = Instance.new("Frame")
  201. frame.Parent = screenGui
  202. frame.Position = UDim2.new(0, 8, 0, 225)
  203. frame.Size = UDim2.new(0, 250, 0, 200)
  204. frame.BackgroundColor3 = BrickColor.new("White").Color
  205. frame.BackgroundTransparency = .5
  206.  
  207. textButton = Instance.new("TextButton")
  208. textButton.Parent = screenGui
  209. textButton.Position = UDim2.new(0, 12, 0, 400)
  210. textButton.Size = UDim2.new(0, 50, 0, 10)
  211. textButton.BackgroundColor3 = BrickColor.new("Really red").Color
  212. textButton.Text = "Red"
  213.  
  214. textButton.MouseButton1Down:connect(function()
  215. red = true
  216. green = false
  217. blue = false
  218. rainbow = false
  219. smooth = false
  220. end)
  221.  
  222. textButton2 = Instance.new("TextButton")
  223. textButton2.Parent = screenGui
  224. textButton2.Position = UDim2.new(0, 75, 0, 400)
  225. textButton2.Size = UDim2.new(0, 50, 0, 10)
  226. textButton2.BackgroundColor3 = BrickColor.new("Really blue").Color
  227. textButton2.Text = "Blue"
  228.  
  229. textButton2.MouseButton1Down:connect(function()
  230. red = false
  231. green = false
  232. blue = true
  233. rainbow = false
  234. smooth = false
  235. end)
  236.  
  237. textButton3 = Instance.new("TextButton")
  238. textButton3.Parent = screenGui
  239. textButton3.Position = UDim2.new(0, 138, 0, 400)
  240. textButton3.Size = UDim2.new(0, 50, 0, 10)
  241. textButton3.BackgroundColor3 = BrickColor.new("Lime green").Color
  242. textButton3.Text = "Green"
  243.  
  244. textButton3.MouseButton1Down:connect(function()
  245. red = false
  246. green = true
  247. blue = false
  248. rainbow = false
  249. smooth = false
  250. end)
  251.  
  252. textButton4 = Instance.new("TextButton")
  253. textButton4.Parent = screenGui
  254. textButton4.Position = UDim2.new(0, 201, 0, 400)
  255. textButton4.Size = UDim2.new(0, 50, 0, 10)
  256. coroutine.wrap(function()
  257. while true do
  258. textButton4.BackgroundColor3 = BrickColor.Random().Color
  259. wait(.05)
  260. end
  261. end)()
  262. textButton4.Text = "Rainbow"
  263.  
  264. textButton4.MouseButton1Down:connect(function()
  265. red = false
  266. green = false
  267. blue = false
  268. rainbow = true
  269. smooth = false
  270. end)
  271.  
  272. textBox = Instance.new("TextBox")
  273. textBox.Parent = screenGui
  274. textBox.Position = UDim2.new(0, 58, 0, 280)
  275. textBox.Size = UDim2.new(0, 150, 0, 20)
  276. textBox.BackgroundColor3 = BrickColor.new("White").Color
  277. textBox.Text = "Type Sound Id here"
  278.  
  279. form = Instance.new("TextButton")
  280. form.Parent = screenGui
  281. form.TextScaled = true
  282. form.Position = UDim2.new(0, 114, 0, 305)
  283. form.Size = UDim2.new(0, 40, 0, 20)
  284. form.BackgroundColor3 = BrickColor.new("White").Color
  285. form.Text = "Up"
  286.  
  287. form.MouseButton1Down:connect(function()
  288. if standingg then
  289. standingg = false
  290. flatt = true
  291. form.Text = "Flat"
  292. elseif flatt then
  293. flatt = false
  294. standingg = true
  295. form.Text = "Up"
  296. end
  297. end)
  298.  
  299. coroutine.wrap(function()
  300. while wait() do
  301. sid = textBox.Text
  302. end
  303. end)()
  304.  
  305. playbutton = Instance.new("TextButton")
  306. playbutton.Parent = screenGui
  307. playbutton.Position = UDim2.new(0, 58, 0, 305)
  308. playbutton.Size = UDim2.new(0, 50, 0, 20)
  309. playbutton.BackgroundColor3 = BrickColor.new("White").Color
  310. playbutton.Text = "Play"
  311.  
  312. playbutton.MouseButton1Down:connect(function()
  313. if not idrewsomething then return end
  314. if soundIsPlaying then
  315. sound1:Remove()
  316. sound1 = Instance.new("Sound", Character)
  317. sound1.Looped = true
  318. sound1.SoundId = "http://www.roblox.com/asset/?id=" .. sid
  319. sound1:Play()
  320. else
  321. soundIsPlaying = true
  322. vol.Text = 1
  323. pitch.Text = 1
  324. sound1 = Instance.new("Sound", Character)
  325. coroutine.wrap(function()
  326. while soundIsPlaying do
  327. wait()
  328. sound1.Volume = svol
  329. end
  330. end)()
  331. sound1.Looped = true
  332. coroutine.wrap(function()
  333. while soundIsPlaying do
  334. sound1.Pitch = pitchh
  335. wait()
  336. end
  337. end)()
  338. sound1.SoundId = "http://www.roblox.com/asset/?id=" .. sid
  339. sound1:Play()
  340. coroutine.wrap(function()
  341. while sound1.IsPlaying and soundIsPlaying do
  342. for i,v in pairs(tab) do
  343. v.Enabled = true
  344. v.Brightness = sound1.PlaybackLoudness/19
  345. v.Range = sound1.PlaybackLoudness/15
  346. if red then
  347. v.Color = Color3.new(sound1.PlaybackLoudness/200, 0,0)
  348. elseif blue then
  349. v.Color = Color3.new(0, 0,sound1.PlaybackLoudness/200)
  350. elseif green then
  351. v.Color = Color3.new(0, sound1.PlaybackLoudness/200,0)
  352. elseif rainbow then
  353. v.Color = brick.BrickColor.Color
  354. end
  355. end
  356. wait()
  357. end
  358. end)()
  359. while sound1.IsPlaying and soundIsPlaying do
  360. workspace.CurrentCamera.FieldOfView = 70 - sound1.PlaybackLoudness/100
  361. bcol = brick.BrickColor
  362. for _,v in pairs(tab2) do
  363. if standingg then
  364. v.Size = Vector3.new(1, sound1.PlaybackLoudness/math.random(10,25), 1)
  365. elseif flatt then
  366. v.Size = Vector3.new(sound1.PlaybackLoudness/math.random(10,25), 1, 1)
  367. end
  368. if red then
  369. v.BrickColor = BrickColor.new(Color3.new(sound1.PlaybackLoudness/200, 0,0))
  370. elseif blue then
  371. v.BrickColor = BrickColor.new(Color3.new(0,0,sound1.PlaybackLoudness/200))
  372. elseif green then
  373. v.BrickColor = BrickColor.new(Color3.new(0,sound1.PlaybackLoudness/200,0))
  374. elseif rainbow then
  375. v.BrickColor = BrickColor.Random()
  376. end
  377. end
  378. wait()
  379. end
  380. end
  381. end)
  382.  
  383. local stopbutton = Instance.new("TextButton")
  384. stopbutton.Parent = screenGui
  385. stopbutton.Position = UDim2.new(0, 158, 0, 305)
  386. stopbutton.Size = UDim2.new(0, 50, 0, 20)
  387. stopbutton.BackgroundColor3 = BrickColor.new("White").Color
  388. stopbutton.Text = "Stop"
  389.  
  390. vol = Instance.new("TextBox")
  391. vol.Parent = screenGui
  392. vol.Position = UDim2.new(0, 58, 0, 330)
  393. vol.Size = UDim2.new(0, 50, 0, 20)
  394. vol.BackgroundColor3 = BrickColor.new("White").Color
  395. vol.Text = "Volume"
  396.  
  397. coroutine.wrap(function()
  398. while wait() do
  399. svol = vol.Text
  400. end
  401. end)()
  402.  
  403. local remove = Instance.new("TextButton")
  404. remove.Parent = screenGui
  405. remove.Position = UDim2.new(0, 108, 0, 370)
  406. remove.Size = UDim2.new(0, 50, 0, 20)
  407. remove.BackgroundColor3 = BrickColor.new("White").Color
  408. remove.Text = "Clean"
  409.  
  410. pitch = Instance.new("TextBox")
  411. pitch.Parent = screenGui
  412. pitch.Position = UDim2.new(0, 158, 0, 330)
  413. pitch.Size = UDim2.new(0, 50, 0, 20)
  414. pitch.BackgroundColor3 = BrickColor.new("White").Color
  415. pitch.Text = "Pitch"
  416.  
  417. coroutine.wrap(function()
  418. while wait() do
  419. pitchh = pitch.Text
  420. end
  421. end)()
  422.  
  423. pitchup = Instance.new("ImageButton")
  424. pitchup.Parent = screenGui
  425. pitchup.Position = UDim2.new(0, 131, 0, 327)
  426. pitchup.BackgroundTransparency = 1
  427. pitchup.Size = UDim2.new(0, 25, 0, 25)
  428. pitchup.Image = "rbxassetid://29563813"
  429.  
  430. pitchup.MouseButton1Down:connect(function()
  431. if soundIsPlaying then
  432. pitch.Text = pitch.Text + .1
  433. end
  434. end)
  435.  
  436. pitchdown = Instance.new("ImageButton")
  437. pitchdown.Parent = screenGui
  438. pitchdown.Rotation = 180
  439. pitchdown.Position = UDim2.new(0, 211, 0, 327)
  440. pitchdown.BackgroundTransparency = 1
  441. pitchdown.Size = UDim2.new(0, 25, 0, 25)
  442. pitchdown.Image = "rbxassetid://29563813"
  443.  
  444. pitchdown.MouseButton1Down:connect(function()
  445. if soundIsPlaying then
  446. pitch.Text = pitch.Text - .1
  447. end
  448. end)
  449.  
  450. remove.MouseButton1Down:connect(function()
  451. if idrewsomething then
  452. if soundIsPlaying then
  453. soundIsPlaying = false
  454. workspace.CurrentCamera.FieldOfView = 70
  455. woosh = Instance.new("Sound",Character)
  456. woosh.Volume = 2
  457. woosh.SoundId = "rbxasstid://215402014"
  458. woosh:Play()
  459. sound1:Stop()
  460. pitch.Text = "Pitch"
  461. vol.Text = "Volume"
  462. removeuseless:AddItem(woosh,2)
  463. for _,v in pairs(tab2) do
  464. v:Remove()
  465. end
  466. idrewsomething = false
  467. elseif not soundIsPlaying then
  468. soundIsPlaying = false
  469. woosh = Instance.new("Sound",Character)
  470. woosh.Volume = 2
  471. woosh.SoundId = "rbxasstid://215402014"
  472. woosh:Play()
  473. for _,v in pairs(tab2) do
  474. v:Remove()
  475. end
  476. idrewsomething = false
  477. end
  478. end
  479. end)
  480.  
  481. local day = Instance.new("TextButton")
  482. day.Parent = screenGui
  483. day.Position = UDim2.new(0, 50, 0, 370)
  484. day.Size = UDim2.new(0, 50, 0, 20)
  485. day.BackgroundColor3 = BrickColor.new("Bright yellow").Color
  486. day.Text = "Day"
  487.  
  488. day.MouseButton1Down:connect(function()
  489. daytime = true
  490. nighttime = false
  491. turnon = Instance.new("Sound",Character)
  492. turnon.SoundId = "rbxassetid://858896518"
  493. turnon.Volume = 1
  494. turnon.Pitch = 1.05
  495. turnon:Play()
  496. removeuseless:AddItem(turnon,2)
  497. coroutine.wrap(function()
  498. while daytime do
  499. game.Lighting.TimeOfDay = 12
  500. game.Lighting.GlobalShadows = true
  501. game.Lighting.Ambient = Color3.fromRGB(10,10,10)
  502. game.Lighting.Brightness = 1
  503. wait()
  504. end
  505. end)()
  506. end)
  507.  
  508. local night = Instance.new("TextButton")
  509. night.Parent = screenGui
  510. night.Position = UDim2.new(0, 165, 0, 370)
  511. night.Size = UDim2.new(0, 50, 0, 20)
  512. night.BackgroundColor3 = BrickColor.new("Really black").Color
  513. night.TextColor = BrickColor.new("White")
  514. night.Text = "Night"
  515.  
  516. night.MouseButton1Down:connect(function()
  517. daytime = false
  518. nighttime = true
  519. turnoff = Instance.new("Sound",Character)
  520. turnoff.SoundId = "rbxassetid://858896518"
  521. turnoff.Volume = 1
  522. turnoff.Pitch = .9
  523. turnoff:Play()
  524. removeuseless:AddItem(turnoff,2)
  525. coroutine.wrap(function()
  526. while nighttime do
  527. game.Lighting.TimeOfDay = 0
  528. game.Lighting.GlobalShadows = false
  529. game.Lighting.Ambient = Color3.new(0,0,0)
  530. game.Lighting.Brightness = 0
  531. wait()
  532. end
  533. end)()
  534. end)
  535.  
  536. volumeup = Instance.new("ImageButton")
  537. volumeup.Parent = screenGui
  538. volumeup.Position = UDim2.new(0, 29, 0, 327)
  539. volumeup.BackgroundTransparency = 1
  540. volumeup.Size = UDim2.new(0, 25, 0, 25)
  541. volumeup.Image = "rbxassetid://29563813"
  542.  
  543. volumeup.MouseButton1Down:connect(function()
  544. if soundIsPlaying then
  545. vol.Text = vol.Text + 1
  546. end
  547. end)
  548.  
  549. volumedown = Instance.new("ImageButton")
  550. volumedown.Parent = screenGui
  551. volumedown.Rotation = 180
  552. volumedown.Position = UDim2.new(0, 111, 0, 327)
  553. volumedown.BackgroundTransparency = 1
  554. volumedown.Size = UDim2.new(0, 25, 0, 25)
  555. volumedown.Image = "rbxassetid://29563813"
  556.  
  557. Supr14 = Instance.new("ImageLabel")
  558. Supr14.Parent = screenGui
  559. Supr14.Rotation = 0
  560. Supr14.Position = UDim2.new(0, 13, 0, 222)
  561. Supr14.BackgroundTransparency = 1
  562. Supr14.Size = UDim2.new(0, 240, 0, 60)
  563. Supr14.Image = "rbxassetid://1815697653"
  564.  
  565. volumedown.MouseButton1Down:connect(function()
  566. if soundIsPlaying then
  567. vol.Text = vol.Text - 1
  568. end
  569. end)
  570.  
  571. stopbutton.MouseButton1Down:connect(function()
  572. if idrewsomething then
  573. if soundIsPlaying then
  574. sound1:Remove()
  575. soundIsPlaying = false
  576. workspace.CurrentCamera.FieldOfView = 70
  577. pitch.Text = "Pitch"
  578. vol.Text = "Volume"
  579. for i,v in pairs(tab) do
  580. v.Enabled = false
  581. end
  582. for i = 1, 10 do
  583. for _,v in pairs(tab2) do
  584. v.BrickColor = BrickColor.new("Really black")
  585. v.Size = v.Size - Vector3.new(0,15,0)
  586. end
  587. wait()
  588. end
  589. end
  590. end
  591. end)
  592.  
  593. print("Drawing visualiser!, Made by Supr14")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement