Advertisement
antoniorigo4

SunVisualizer

Aug 11th, 2020 (edited)
2,310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. local plr = owner
  2. local sun = Instance.new("Part",plr.Character)
  3. sun.Material = Enum.Material.Neon
  4. sun.Size = Vector3.new(2,2,2)
  5. sun.Shape = "Ball"
  6. sun.BrickColor = BrickColor.new("New Yeller")
  7. local weld = Instance.new("Motor6D",sun)
  8. weld.Part0 = sun
  9. weld.Part1 = plr.Character.Head
  10. weld.C0 = CFrame.new(0,-3.5,0)
  11. local mesh = Instance.new("SpecialMesh",sun)
  12. mesh.MeshType = Enum.MeshType.Sphere
  13. local event = Instance.new("RemoteEvent",plr.Character)
  14. local sound = Instance.new("Sound",plr.Character.Head)
  15. sound.Looped = true
  16. sound.Volume = 10
  17. event.OnServerEvent:Connect(function(player,playl)
  18.     print(player,playl)
  19.     local playback = (playl*0.01)+0.1  
  20. mesh.Scale = Vector3.new(playback,playback,playback)
  21. end)
  22. plr.Chatted:Connect(function(msg)
  23.         if msg:sub(1,5) == "/play" then
  24.         local victim = msg:sub(1,5)
  25.                     local soundid = string.gsub(msg,victim,"")
  26.             sound.SoundId = "rbxassetid://"..soundid   
  27.         sound:Play()
  28.         end
  29. end)
  30. NLS([[
  31.     local remote = script.Parent:WaitForChild("RemoteEvent")
  32.     local sound = script.Parent.Head:WaitForChild("Sound")
  33. while true do wait()   
  34. remote:FireServer(sound.PlaybackLoudness)
  35.     end]],plr.Character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement