u/Eastern_Strength_370

hopefully easy script question

hello! m trying to combine two script functions that work by themselves but cant seem to figure it out. script 1 is linked to all my other ui elements, it plays the single track BgMusic, and stops it when pressing the mute button in settings. Script 2 is a random playlist, that calls different sounds in a group and plays them in a random order.

how do i use this code to edit script 1 to pull the random songs from SFX instead of just looping the Bg music. Thanks! sorry total noob here

SCRIPT 1

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local SoundService = game:GetService("SoundService")

local Remotes = ReplicatedStorage.Remotes.UI

local SettingsConfig = require(ReplicatedStorage.Configs.SettingsConfig)

local StateManager = require(ReplicatedStorage.Client.State)

local function PlayMusic()

local isMusicEnabled = SettingsConfig.IsSettingActive("Music", StateManager.GetData())

if isMusicEnabled then

	local isAlreadyPlaying = SoundService.SFX.BgMusic.Playing

	if not isAlreadyPlaying then

	SoundService.SFX.BgMusic:Play()

	end

else

	SoundService.SFX.BgMusic:Stop()

end

end

PlayMusic()

Remotes.UpdateSetting.OnClientEvent:Connect(function(setting)

local isMusicSetting = setting == "Music"

if isMusicSetting then

	task.delay(0, PlayMusic)

end

end)

SCRIPT FOR RANDOM PLAYLIST STANDALONE

local SoundGroup = game.SoundService.SFX -- Change SoundGroup to whatever you named your SoundGroup

local Playlist = {

SoundGroup.Sound1,

SoundGroup.Sound2,

SoundGroup.Sound3,

\-- Add more sounds if needed

}

local function PlayRandomSound()

local randomIndex = math.random(1, #Playlist)

local Sounds = Playlist\[randomIndex\]



if Sounds then

	Sounds:Play()

	Sounds.Ended:Wait()

end

end

reddit.com
u/Eastern_Strength_370 — 4 days ago

looking for feedback on first project!

hello! been working on enviorment design the past few weeks. did all the models, textures and foliage from scratch. going for a cartoony, slightly surreal/impressionist vibe.

i was wondering what your overall impression of the scene is on first glance? any likes or dislikes? how is the lighting?

im maybe 50% done with the project but looking for input.

u/Eastern_Strength_370 — 5 days ago

first month of design work!

working on creating in a style that is super cartoony. i want the models themselves to seem impressionist/ gouche inspired.

everything is being done from scratch in blender/ fesco. its a little slow moving rite now (im new to all of these programs and studio). lmk what you think!

u/Eastern_Strength_370 — 10 days ago

its a long shot posting this here buuut: if anyone makes music on the computer, it would be so fun to pass some projects back and forth!

i have a handful of unfinshed projects with some nice melodies/ themes that i feel would be well recieved. and i would love to work with you on a piece you have if you got one. :) have a great day yall!

reddit.com
u/Eastern_Strength_370 — 22 days ago

has anyone successfully recovered from, or successfully managed the above two injuries? i have been dealing with these for 3+ months and the back and forth is driving me crazy.

hurt myself stupidly, by sprinting for multiple sessions, with poor form and basically no padding. been to a few PTs now and they say it is both cmp and pt. sitting in a chair for a long period, and deep squating, make it awful. i have full range of motion but cant load it, or will have sleepless level pain for days afterward.

originally was stuck in the "boom bust" cycle of losing function. with the pt excercises, i think its turning around slowly? focusing on engaging glutes when walking seems to help relieve pressure. idfk at this point. i just want to be able to resting squat again one day.

if you have had either of, (or especially) both of these knee problems and recovered/ managed, what did that look like for you? thanks.

reddit.com
u/Eastern_Strength_370 — 24 days ago

has anyone successfully recovered from, or successfully managed the above two injuries? i have been dealing with these for 3+ months and the back and forth is driving me crazy.

originally was stuck in the "boom bust" cycle of losing function. with the pt excercises, i think its turning around slowly? idfk at this point. i just want to be able to deep squat again one day -.-

if you have had either of, or both of these knee problems and recovered/ managed. what did that look like for you? thanks.

reddit.com
u/Eastern_Strength_370 — 24 days ago