Advertisement
antoniorigo4

TrailVisualizer

Oct 3rd, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. local player = owner
  2. local sound = Instance.new("Sound",player.Character.Head)
  3. player.Chatted:Connect(function(msg)
  4. if msg:sub(1,5) == "/play" then
  5. local victim = msg:sub(1,5)
  6. local soundid = string.gsub(msg,victim,"")
  7. sound.SoundId = "rbxassetid://"..soundid
  8. sound:Play()
  9. elseif msg:sub(1,5) == "/stop" then
  10. sound:Stop()
  11. end
  12. end)
  13. local LOUDREMOTE = Instance.new("RemoteEvent",player.Character)
  14. local part1 = Instance.new("Part",player.Character)
  15. local part2 = Instance.new("Part",player.Character)
  16. part1.Anchored = true part2.Anchored = true
  17. part1.Position = Vector3.new(29, 7, 0) part2.Position = Vector3.new(9, 7, 0)
  18. local beam = Instance.new("Beam",part1)
  19. local a1 = Instance.new("Attachment",part1)
  20. local a2 = Instance.new("Attachment",part2)
  21. beam.Attachment0 = a1
  22. beam.Attachment1 = a2
  23. LOUDREMOTE.OnServerEvent:Connect(function(plr,loud)
  24. local randomnumber = math.random(13,19)
  25. beam.Width0 = (loud/math.random(50,75))
  26. beam.Width1 = (loud/math.random(45,80))
  27. beam.Color = ColorSequence.new(Color3.fromRGB(loud/randomnumber,loud/randomnumber,loud/randomnumber))
  28. end)
  29. game:GetService("RunService")
  30. NLS([[
  31. local player = game.Players.LocalPlayer
  32. local sound = player.Character.Head.Sound
  33. game:GetService("RunService").RenderStepped:Connect(function()
  34. player.Character.RemoteEvent:FireServer(sound.PlaybackLoudness)
  35. end)
  36. ]],player.Character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement