For example, if the Red team earns a certain amount of points on the leaderboard, an audio will play. This would be different for the color of the team, so if blue team wins, a different audio plays.
How would I script an 'audio upon victory'?
1 answer
This isn't a request site, but to help you get started I'll give you this:
You could start by having two IntValues - one for each team - to act as a counter for each team's number of points. You can come up with how/when you want points added to these however you want.
Then you could make another script with two functions that get called whenever either one of the IntValues' value changes. You could do this by doing for example:
RedPoints.Changed:connect(function)and BluePoints.Changed:connect(function).
These could lead to individual functions that will check the number of points for each team.
Inside these functions you could have if statements to check if one of the teams has exceeded a certain number of points needed to win.
Here's a little script to help you get started:
function RedChecker(points) -- This is fired when the number of points on the red team changes
if points >= 100 then -- This then checks if the number of points is over or equal to a certain number of points, in this case 100
game.Workspace.RedSound:Play() -- This will play the audio for when red team wins, you can change the "RedSound" to whatever you name your sound
end
end
-- This is exactly the same as the function for red team, instead this is for blue team.
function BlueChecker(points)
if points >= 100 then
game.Workspace.BlueSound:Play()
end
end
game.Workspace.RedPoints.Changed:connect(RedChecker)-- RedPoints would be the name of the IntValue for the red team
game.Workspace.BluePoints.Changed:connect(BlueChecker) -- BluePoints would be the name of the IntValue for the blue team
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
"Please upvote if this helped you", The upvote button isn't to be abused. It's only if someone makes a good quality question. This is a good quality question but asking for upvotes when not really needed is not good.