Advertisement
antoniorigo4

Draw visualizer

Aug 12th, 2020 (edited)
2,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.60 KB | None | 0 0
  1. local player = owner--hey guys please dont use this script for inappropriate purposes.
  2.  
  3. local pressremote = Instance.new("RemoteEvent",player.Character)
  4. pressremote.Name = "pressremote"
  5.  
  6. local hitremote = Instance.new("RemoteEvent",player.Character)
  7. hitremote.Name = "hitremote"
  8.  
  9. local loudremote = Instance.new("RemoteEvent",player.Character)
  10. loudremote.Name = "loudremote"
  11.  
  12. local garbage = Instance.new("Model",player.Character)
  13. local sound = Instance.new("Sound",player.Character.Head)
  14. sound.Volume = 10
  15. player.Chatted:Connect(function(msg)
  16.         if msg:sub(1,5) == "/play" then
  17.         local victim = msg:sub(1,5)
  18.                     local soundid = string.gsub(msg,victim,"")
  19.             sound.SoundId = "rbxassetid://"..soundid    
  20.         sound:Play()
  21.         end
  22. end)
  23. pressremote.OnServerEvent:Connect(function(player,press)
  24.     if press == "e" then
  25.         sound:Play()
  26.     elseif press=="r" then
  27.         sound:Stop()
  28.     elseif press=="f" then
  29.         garbage:ClearAllChildren()
  30.     end
  31. end)
  32. hitremote.OnServerEvent:Connect(function(player,hit)
  33.     local visual = Instance.new("Part",garbage)
  34.         visual.CFrame = hit
  35.         visual.Size = Vector3.new(1,0.1,1)
  36.         visual.Anchored = true
  37.         visual.Orientation = Vector3.new(0,0,0)
  38.         visual.Material = Enum.Material.Neon    
  39. end)
  40. loudremote.OnServerEvent:Connect(function(player,loud)
  41.     for i,v in pairs(garbage:GetDescendants()) do
  42.         v.Size = Vector3.new(1,loud*0.1/math.random(2,5),1)
  43.         v.Color = Color3.fromRGB(loud/math.random(2,5),loud/math.random(2,5),loud/math.random(2,5))
  44.     end
  45. end)
  46. NLS([[
  47.     local player = game.Players.LocalPlayer
  48. local mouse = player:GetMouse()
  49. local press = player.Character.pressremote
  50. local hit = player.Character.hitremote
  51. local loud = player.Character.loudremote
  52. local clicked = false
  53. mouse.Button1Down:connect(function()
  54.       clicked = true
  55. end)
  56. mouse.Button1Up:connect(function()
  57.        clicked = false
  58. end)
  59. coroutine.resume(coroutine.create(function()
  60.  while true do wait()
  61.     if clicked == true then
  62.     hit:FireServer(mouse.Hit)
  63.         end
  64. end
  65. end))
  66. mouse.KeyDown:connect(function(key)
  67.         if key:lower() == "e" or key:upper() == "E" then
  68.         press:FireServer("e")
  69.     elseif key:lower() == "r" or key:upper() == "R" then
  70.         press:FireServer("r")
  71.     elseif key:lower() == "f" or key:upper() == "F" then
  72.         press:FireServer("f")
  73.         end
  74. end)
  75. local run = game:GetService("RunService")
  76. run.Stepped:Connect(function()
  77.     loud:FireServer(player.Character.Head.Sound.PlaybackLoudness)
  78. end)
  79.  
  80.     ]],player.Character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement