generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

How to keep local sound from resetting at death?

Previous Thread :: Next Thread 
Naquadria is not online. 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
megamario640 is not online. megamario640
Joined: 07 Jun 2008
Total Posts: 15967
13 Dec 2015 12:08 AM
Put this somewhere in your script:

game.StarterGui.ResetPlayerGuiOnSpawn = false
Report Abuse
Naquadria is not online. Naquadria
Joined: 03 Nov 2010
Total Posts: 11936
13 Dec 2015 12:08 AM
"(without stopping every gui from resetting)"
Report Abuse
megamario640 is not online. megamario640
Joined: 07 Jun 2008
Total Posts: 15967
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image