Naquadria
|
  |
| Joined: 03 Nov 2010 |
| Total Posts: 11936 |
|
|
| 13 Dec 2015 12:04 AM |
script.Name = "playSong"
--// Settings
--// Initialization
local Create = LoadLibrary("RbxUtility").Create
local tracks = { { {"Horizon", 120}, {"MainTheme", 120}, {"PastToPresent", 78.7}, {"Secunda", 115.2}, {"Masser", 110}, {"Dawn", 116}, {"StreetsOfWhiterun", 120}, {"Frostfall", 118}, {"BanneredMare", 94}, {"OblivionTheme", 110}, {"GloryOfCryodiil", 116}, } }
--// Functions
function playSong() while true do for track = 1, #tracks do local songData = tracks[track] for index = 1, #songData do local clipData = songData[index] print(clipData[1]) local newSound = script[clipData[1]]:Clone() newSound.Parent = script newSound:Play() shared.songIsPlaying = true wait(clipData[2] - 0.5) print("donewait") --[[Spawn(function() wait(0.5) newSound:Destroy() end)]] end wait(2) end end end
function main() wait(1) playSong() end
main()
Thats in a localscript in startergui, but if a player dies it resets at the first sound, is it possible to stop this? (without stopping every gui from resetting) |
|
|
| Report Abuse |
|
|
| 13 Dec 2015 12:08 AM |
Put this somewhere in your script:
game.StarterGui.ResetPlayerGuiOnSpawn = false
|
|
|
| Report Abuse |
|
Naquadria
|
  |
| Joined: 03 Nov 2010 |
| Total Posts: 11936 |
|
|
| 13 Dec 2015 12:08 AM |
| "(without stopping every gui from resetting)" |
|
|
| Report Abuse |
|
|
| 13 Dec 2015 12:12 AM |
Oh. I didn't register that 'cause it's past midnight here =P
Hmm, could you set the point the Sound is at (probably be in seconds) to a variable, move it to ReplicatedStorage, and then move it back as soon as the player spawns? |
|
|
| Report Abuse |
|