Play a sound locally based on a value

hi, what i’m trying to make is to play a sound locally, based on a value in a BoolValue in serverstorage, which is estabilished in a serverscript. here is my script, why doesn’t it work? (local script in starter gui)

local Soundservice = game.SoundService
local Player = game.Players.LocalPlayer
local gameinprogress = game.ServerStorage.GameValues.GameInProgress

if gameinprogress.Value == false then
	Soundservice.Theme.Playing = false
	Soundservice.Map.Playing = false
	Soundservice.countdown.Playing = false
end

gameinprogress:GetPropertyChangedSignal("Value"):Connect(function()
	if gameinprogress.Value == true then
		Soundservice.Theme.Playing = false
		Soundservice.Map.Playing = true
		Soundservice.countdown.Playing = false
	end
end)

GameInProgress is a BoolValue btw

Clients do not have access to anything stored in ServerStorage, hence the name. I’d recommend moving the BoolValue to ReplicatedStorage. Both the Server and Client can access ReplicatedStorage and any changes made by the server will be replicated to the client.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.