Hello fellow developers, I am currently having some issues regarding a Local script. I am not a great scripter so I could use some help from someone with a fresh mind unlike me.
I have a folder with a bunch random sounds that plays after every message that a player types, and I want the WHOLE server to hear these sounds. Not just the local player.
Here is a screenshot of the script and the explorer (I include this picture because it might be helpful for some people that actually knows what I’m trying to accomplish)
I’ve looked around for some solutions online but no one is having the same issue as me (Sad face)
local Replicated = game:GetService("ReplicatedStorage")
local Player = game:GetService("Players").LocalPlayer
Player.Chatted:Connect(function(message: string)
local randomMusic = Replicated.Sounds:GetChildren()[math.random(1,# Replicated.Sounds:GetChildren())]
randomMusic:Play()
end)
I am also including the script as a lua format above because i thought that would look professional.