Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with placement of two functions with random sounds?

Asked by 9 years ago

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
0
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 be BlueTaslem 18071 — 9y
0
Oh okay, but do you know where the functions should be placed? ShadowWolfXZ 25 — 9y
0
Blue: Assuming you meant == by -- I replaced it with one = and Studio gave error. ShadowWolfXZ 25 — 9y

Answer this question