SHARE
TWEET

Untitled

a guest Mar 20th, 2017 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --@name Pitch Control for Sound
  2. --@author
  3. --@shared
  4.  
  5. if SERVER then
  6.     wire.adjustInputs({"Button"},{"normal"})
  7.     hook.add("input","input",function(k,v)
  8.         if k=="Button" then
  9.             net.start("song")
  10.             net.writeString(tostring(v))
  11.             net.send()
  12.         end
  13.     end)
  14. else
  15.    
  16.     Pitch = 0
  17.  
  18.     hook.add("net", "net", function(name)
  19.         if name == "song" then
  20.             Pitch = tonumber(net.readString())
  21.         end    
  22.     end)
  23.    
  24.     bass.loadURL("http://k003.kiwi6.com/hotlink/grznmt08u0/mazda_rotary_idle.mp3", "3d noblock", function(snd)
  25.     if snd then
  26.             song = snd
  27.             snd:setFade(500,100000)
  28.             snd:setLooping(true)
  29.             snd:setVolume(1)
  30.             hook.add("think","snd",function()
  31.                 snd:setPitch(1 + (Pitch*0.005))
  32.                 snd:setPos(chip():getPos())
  33.             end)
  34.         end
  35.     end)
  36.  
  37. end
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top