Advertisement
plytalent

VISCONTROL TEST

Mar 29th, 2019
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.32 KB | None | 0 0
  1. visdisplay = Instance.new("Part",owner.Character)
  2. visdisplay.Anchored = false
  3. visdisplay.Name = "VISDISPLAY"
  4. visdisplay.CanCollide = false
  5. wled = Instance.new("Weld",owner.Character)
  6. visdisplay.Position = Vector3.new(owner.Character.Torso.Position.x,-3.25 - owner.Character.Torso.Position.y,owner.Character.Torso.Position.z)
  7. wled.Part0 = visdisplay
  8. wled.Part1 = owner.Character.Torso
  9. wled.C0 = CFrame.new(0,-3.5,0)
  10. --visdisplay.Shape = "Cylinder"
  11. visdisplay.Size = Vector3.new(0,0,0)
  12. remote = Instance.new("RemoteEvent",owner.Character)
  13. remote.Name = "RemoteEventREEE"
  14. remote.OnServerEvent:Connect(function(player,playbackl)
  15.     visdisplay.Size =Vector3.new(playbackl/50,1,playbackl/50)
  16.     visdisplay.Material = "Plastic"
  17. --  visdisplay.Transparency = playbackl/500
  18. --  game:GetService("RunService").Heartbeat:Wait()
  19.     visdisplay.Color = Color3.fromHSV(playbackl,1,1)
  20. end)
  21.  
  22. NLS([==[local sound  = game:GetService("Players").LocalPlayer.Character:WaitForChild("VIS")
  23. local remote = game:GetService("Players").LocalPlayer.Character:WaitForChild("RemoteEventREEE")
  24. game:GetService("RunService").Stepped:connect(function()
  25.     remote:FireServer(sound.PlaybackLoudness)
  26. end)
  27. ]==],owner.Character)
  28.  
  29. ID = nil
  30. VOL = nil
  31. PITCH = nil
  32. local Sound =Instance.new("Sound",owner.Character)
  33. Sound.Name = "VIS"
  34. local arevisstill = owner.Character:FindFirstChild("VIS")
  35. function VISCONTROL(id,vol,pitch)
  36.     Sound.SoundId = "rbxassetid://"..id
  37.     Sound.Pitch = pitch or 1
  38.     Sound.Volume = vol or 1
  39.     ID = id
  40.     VOL = vol
  41.     PITCH = pitch
  42. end
  43. owner.Chatted:connect(function(Message)
  44.     if Message then
  45.         print(Message)
  46.         if string.sub(Message,1,3) == "id/" then
  47.             print(string.sub(Message,4))
  48.             VISCONTROL(string.sub(Message,4),1,1)
  49.         end
  50.         if string.sub(Message,1,4) == "vol/" then
  51.             VISCONTROL(ID,string.sub(Message,5),PITCH)
  52.         end
  53.         if string.sub(Message,1,6) == "pitch/" then
  54.             VISCONTROL(ID,VOL,string.sub(Message,7))
  55.         end
  56.         if string.sub(Message,1,5) == "play/" then
  57.             Sound:Play()
  58.         end
  59.     end
  60. end)
  61. game:GetService("RunService").Heartbeat:connect(function()
  62. wait(1/30)
  63. if arevisstill == nil then
  64.     Sound =Instance.new("Sound",owner.Character)
  65.     Sound.Name = "VIS"
  66. elseif Sound.IsPaused == true then
  67.     Sound:Play()
  68. elseif Sound.IsPlaying == false then
  69.     Sound:Play()
  70. end
  71. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement