So I edited the script provided by @Valkyrop. I’m making it if the sound that i’m choosing plays 2 times. , the player get kicked from the game. However there is two sounds playing. Which is not what I wanted. I don’t know how to fix this
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()
if Replicated.Sounds.YE:Play() then
Player:Kick("You made him sad.")
end
end)
Anyone can help ?