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.
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
Closed as Not Constructive by Shawnyg and EzraNehemiah_TF2
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?