Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How I make an sound script?

Sound script, Like an Music GUI list. If you make me an GUI Music List, That would be nice.

2 answers

First of all, you need to make the gui, the frame, and a text button in the frame. After adjusting all of those things, you can put this script into the text button.

Make sure this is a LOCALSCRIPT also.

local id=193241--Some random numbers here, but your song id goes here.

script.Parent.MouseButton1Down:connect(function()
	local removesound=game.Players.LocalPlayer.PlayerGui.PlayerGui:findFirstChild("Sound")
	if removesound~=nil then
		removesound:Stop()
		removesound:Destroy()
	end 
	s=Instance.new("Sound",game.Players.LocalPlayer.PlayerGui)
	s.Volume=1
	s.Name="SSound"
	s.Looped=true--Idk if you want it looped or not.
	s.SoundId="http://www.roblox.com/asset/?id="..id
	s:Play()
end)

This is an Example from Kohl's Admin Commands;

local s = Instance.new("Sound", game:service("Players").LocalPlayer.PlayerGui) s.SoundId = "http://www.roblox.com/asset/?id=IDHERE" s.Volume = 1 s.Pitch = pitch s.Looped = true s.archivable = false repeat s:Play() wait(2.5) s:Stop() wait(.5) s:Play() until s.IsPlaying

Or another way;

local s=Instance.new("Sound")
local s.Looped,s.SoundId,s.Archivable,s.Pitch,s.Volume,s.Parent=true,"http://www.roblox.com/asset/?id=IDHERE",false,1,0.7,game:service("Players").LocalPlayer.PlayerGui

wait(.50)
s:Play()

Or;

function sound(type,pitch,volume,loop,arch,par,id,time)
s=Instance.new(type)
s.Parent=par
s.Pitch=pitch
s.Volume=volume
s.Looped=loop
s.Archivable=arch
s.SoundId=id
wait(time)
if s~=0 then
s:Play()
end end

sound("Sound",1,0.7,true,false,workspace,"http://www.roblox.com/asset/?id="..142285147,.50)

I hope this was useful! ;)

1 comment

0

Sorry I didn't know you meant a GUI. :l So very sorry.

This discussion is preserved as it was. New answers, comments, and votes are closed.