Advertisement
Friks12829

soundeffects

May 24th, 2023 (edited)
18,329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. local a;if CLIENT then a={}end;local b;function DC_ReadSound(c,d)if ix and ix.option.Get("SoundEffect",true)==false then return end;local e;local f;if b and CLIENT then b:Stop()end;if not a[c]then if string.find(c,"http")then e.PlayURL(c,"mono",function(g)if IsValid(g)then g:SetPos(LocalPlayer():GetPos())g:Play()e=g;b=e;a[c]={e,f}end end)else e=CreateSound(game.GetWorld(),c,f)b=e end;if e then e:SetSoundLevel(0)if CLIENT then a[c]={e,f}end end else e=a[c][1]b=e;f=a[c][2]end;if e then if CLIENT then e:Stop()end;e:Play()if d then timer.Simple(math.Clamp(d,60,120),function()if not e then return end;e:ChangeVolume(0,6)end)end end;return e end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement