Hello I am making a round end in my game and well I need a script that checks if all players died and then does the end_game() function instead of putting that in every line. can someone tell me how can i call a function using another script thank you.
The Function:
function end_game()
wait()
wait(1)
script.GameMusic:Stop()
script.GameMusicTwo:Stop()
script.TankMusic:Stop()
script.TankMusic2:Stop()
script.ElevatorMusic:Stop()
script.LobbyMusic:Stop()
script.GameMusicAmbient:Stop()
Text = "You have failed."
script.Scream3:Play()
game.ReplicatedStorage.TextEvent:FireAllClients(Text)
wait(5)
print("Game is resetting...")
end