I'm trying to place two functions that plays a list of random sounds, one for when the class of: Murderer wins/loses and one for when the class of: Innocent wins/loses. Alright, so what's the problem? I don't know where the functions should be placed in the script. P.S. The audio should be placed in a way that it plays as soon as the text of "[Class] wins" shows up on the GUI.
event.OnClientEvent:connect(function(...)
local tuple = {...}
if tuple[1] == "Result" then
if tuple[2] == "BloxxerWin" then
resultname.Text = "MURDERER wins"
resultname.TextColor3 = Color3.new(170/255, 0/255, 0/255)
else
resultname.Text = "PLAYERS win"
resultname.TextColor3 = Color3.new(0/255, 170/255, 255/255)
end
resultprompt.Visible = true
wait(7)
resultprompt.Visible = false

3 comments
Why are you using
...like that? If you know the number of parameters (in this case, 2) you shouldn't use that -- it makes your code way more confusing than it needs to beOh okay, but do you know where the functions should be placed?
Blue: Assuming you meant == by -- I replaced it with one = and Studio gave error.