Never trust the client. Use a RemoteEvent instead for better gameplay. I don't think you would let exploiters play their sounds so everyone can hear it.
SERVERSCRIPT
local Event = Instance.new("RemoteEvent");
Event.Name = "Sound Event";
Event.Parent = game:GetService("ReplicatedStorage");
Event.OnClientEvent:Connect(function(Player, check)
if check == "PLAY_SONG_EVENT" then
local h = Instance.new("Sound")
h.Parent = Player:WaitForChild("PlayerGui")
h:Play()
LOCALSCRIPT
local Event = game:GetService("ReplicatedStorage"):WaitForChild("Sound Event")
Event:FireAllClients("PLAY_SONG_EVENT")
2 comments
Turn off RespectFilteringEnabled so others can hear it. And don't have the spaces. And use local functions.
Alright, thanks