Advertisement
fusionfriends

BodyScale Visualizer

Nov 12th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local Player = owner
  3. repeat wait() until Player.Character
  4. local Character = Player.Character
  5. local Humanoid = Character.Humanoid
  6. local LoudnessEvent = Instance.new("RemoteEvent")
  7. LoudnessEvent.Name = "LoudnessEvent"
  8. LoudnessEvent.Parent = NLS([==[
  9. local Character = script.Parent.Parent.Character
  10. local Theme = nil
  11. Character.DescendantAdded:Connect(function(Descendant)
  12. if Descendant:IsA("Sound") then
  13. if Descendant.Name == "Theme" then
  14. Theme = Descendant
  15. end
  16. end
  17. end)
  18. game:GetService("RunService").Heartbeat:Connect(function()
  19. if Theme ~= nil then
  20. script.LoudnessEvent:FireServer(Theme.PlaybackLoudness)
  21. end
  22. end)
  23. ]==],Player.PlayerGui)
  24. Humanoid.BodyHeightScale.Value = 0.6
  25. Humanoid.BodyDepthScale.Value = 0.6
  26. Humanoid.BodyWidthScale.Value = 0.6
  27. Humanoid.HeadScale.Value = 0.6
  28. function Connect()
  29. Player.Chatted:Connect(function(Msg)
  30. if string.lower(Msg:sub(1,7)) == "/e play" then
  31. local ID = Msg:sub(9,#Msg)
  32. PlaySong(ID)
  33. end
  34. end)
  35. end
  36. if Character.Humanoid.RigType ~= Enum.HumanoidRigType.R15 then
  37. warn("You must be R15 in order to use this script")
  38. else
  39. Connect()
  40. end
  41. function PlaySong(ID)
  42. if Character.HumanoidRootPart:FindFirstChild("Theme") then
  43. Character.HumanoidRootPart.Theme:Destroy()
  44. end
  45. local Theme = Instance.new("Sound")
  46. Theme.Name = "Theme"
  47. Theme.Volume = 3
  48. Theme.SoundId = ("rbxassetid://"..ID)
  49. Theme.Looped = true
  50. Theme.Parent = Character.HumanoidRootPart
  51. Theme:Play()
  52. end
  53. LoudnessEvent.OnServerEvent:Connect(function(Plr,Loudness)
  54. Humanoid.BodyHeightScale.Value = Loudness/1000+0.6
  55. Humanoid.BodyDepthScale.Value = Loudness/1000+0.6
  56. Humanoid.BodyWidthScale.Value = Loudness/1000+0.6
  57. Humanoid.HeadScale.Value = Loudness/1000+0.6
  58. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement